Esempio n. 1
0
        bool CheckFront(CharacterControl control)
        {
            foreach (GameObject o in control.FrontSpheres)
            {
                Debug.DrawRay(o.transform.position, control.transform.forward * 0.3f, Color.yellow);
                RaycastHit hit;
                if (Physics.Raycast(o.transform.position, control.transform.forward, out hit, blockDistance))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 2
0
        // Start is called before the first frame update
        void Start()
        {
            photonView = GetComponent <PhotonView>();
            runner     = FindObjectOfType <CharacterControl>();
            bodyObject = runner.transform.Find("Gremilin");

            if (photonView.IsMine)
            {
                foreach (var item in GetComponentsInChildren <Renderer>())
                {
                    item.enabled = false;
                }
            }
        }
Esempio n. 3
0
        bool CheckUpperFront(CharacterControl control)
        {
            for (int i = 5; i < 11; i++)
            {
                GameObject o = control.FrontSpheres[i];
                RaycastHit hit;
                if (Physics.Raycast(o.transform.position, control.transform.forward, out hit, blockDistance))
                {
                    return(true);
                }
            }

            return(false);
        }
        public override void UpdateAbility(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl control = characterState.GetCharacterControl(animator);

            if (stateInfo.normalizedTime >= checkTime)
            {
                if (control.Grounded)
                {
                    //control.Grounded = true;
                    animator.SetBool(TransitionParameter.Grounded.ToString(), true);
                }
                else
                {
                    //control.Grounded = false;
                    animator.SetBool(TransitionParameter.Grounded.ToString(), false);
                }
            }
        }
        private bool MakeTransition(CharacterControl control)
        {
            foreach (TransitionConditionType c in transitionConditions)
            {
                switch (c)
                {
                case TransitionConditionType.JUMP:
                {
                }
                break;

                case TransitionConditionType.GRABBING_LEDGE:
                {
                }
                break;
                }
            }
            return(true);
        }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     control = GetComponentInParent <CharacterControl>();
 }
Esempio n. 7
0
 private void ToggleGrav(CharacterControl control)
 {
     control.rb.velocity   = Vector3.zero;
     control.rb.useGravity = on;
 }
Esempio n. 8
0
 // Start is called before the first frame update
 void Start()
 {
     capCollider = GetComponent <CapsuleCollider>();
     control     = GetComponentInParent <CharacterControl>();
 }
Esempio n. 9
0
 private void Awake()
 {
     characterControl = this.gameObject.GetComponent <CharacterControl>();
 }
Esempio n. 10
0
 // Start is called before the first frame update
 void Start()
 {
     control = GetComponentInParent <CharacterControl>();
     control.LedgeGrabbed = false;
 }