Ejemplo 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);
        }
Ejemplo 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;
                }
            }
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }
Ejemplo n.º 5
0
        private bool MakeTransition(CharacterControl control)
        {
            foreach (TransitionConditionType c in transitionConditions)
            {
                switch (c)
                {
                case TransitionConditionType.JUMP:
                {
                }
                break;

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