This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class MovePlayer : MonoBehaviour { | |
public float speed = 6.0F; | |
public float jumpSpeed = 8.0F; | |
public float gravity = 20.0F; | |
private Vector3 moveDirection = Vector3.zero; | |
void Update() { | |
CharacterController controller = GetComponent<CharacterController>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transform target; | |
float rotateSpeed = 10; | |
// Use this for initialization | |
void Start () { | |
// 將 target指定名稱為Imege的物件,並取得物件的Transform | |
target = GameObject.Find("Image").GetComponent<Transform>(); | |
} | |
void Update () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 著地判斷 | |
public LayerMask isGroundedSlopeLayer; | |
public float isGroundedSlopeDis = 0.5f; | |
// 如果傳入 !isJumped 判斷是否在地面,於角色腳下斜後方打出射線來判斷 | |
// 如果在斜坡上則返回true | |
// 如果不在斜坡上且角色控制器也不在地面則返回false | |
// 如果傳入 isJumped 判斷是否在斜面上,避免在斜面上無法操作一些動作或修正 | |
// ex. 由於跳躍高度不夠快而黏在樓梯、由於樓梯上的重力不足而出現浮空狀態 | |
bool isGroundedSlope(bool isJumped) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class PlaneRayCast : MonoBehaviour { | |
// 射線長度 | |
public float rayLength = 100; | |
// 射線擊中資訊 | |
RaycastHit hit; | |
// 設定設線偵測圖層 | |
public LayerMask wallLayer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sdgsdgsdgsdg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class enemyMovement : MonoBehaviour { | |
NavMeshAgent agent; | |
void Start () { | |
agent = GetComponent< NavMeshAgent >(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class DestroySelf : MonoBehaviour { | |
public bool activeBool = false; | |
public TweenAlpha mTweenAlpha; | |
public TweenScale mTweenScale; | |
void Awake() | |
{ | |
mTweenAlpha = GetComponent<TweenAlpha> (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class BackpackManager : MonoBehaviour { | |
public List<ItemData.ItemAttribute> _BackpackItem = new List<ItemData.ItemAttribute>(); | |
public List<ItemData.ItemAttribute> m_BackpackItem { | |
get { | |
return _BackpackItem; | |
} |
OlderNewer