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);
        }
Beispiel #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;
                }
            }
        }
        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);
        }
 // Start is called before the first frame update
 void Start()
 {
     control = GetComponentInParent <CharacterControl>();
 }
 private void ToggleGrav(CharacterControl control)
 {
     control.rb.velocity   = Vector3.zero;
     control.rb.useGravity = on;
 }
Beispiel #8
0
 // Start is called before the first frame update
 void Start()
 {
     capCollider = GetComponent <CapsuleCollider>();
     control     = GetComponentInParent <CharacterControl>();
 }
 private void Awake()
 {
     characterControl = this.gameObject.GetComponent <CharacterControl>();
 }
Beispiel #10
0
 // Start is called before the first frame update
 void Start()
 {
     control = GetComponentInParent <CharacterControl>();
     control.LedgeGrabbed = false;
 }