Example #1
0
 private void Update()
 {
     if (mouseHoverSelect.selectedCharacterType == PlayableCharacterType.NONE)
     {
         HoverSelectedCharacter = null;
         light.enabled          = false;
     }
     else
     {
         light.enabled = true;
         LightUpSelectedCharacter();
     }
 }
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (characterControl == null)
            {
                CharacterControl control = animator.transform.root.GetComponent <CharacterControl>();

                control.CacheCharacterControl(animator);
            }

            foreach (StateData d in ListAbilityData)
            {
                d.OnEnter(this, animator, stateInfo);
            }
        }
Example #3
0
 public void CheckCombo(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateInfo.normalizedTime >= StartAttackTime + ((EndAttackTime - StartAttackTime) / 3f))
     {
         if (stateInfo.normalizedTime < EndAttackTime + ((EndAttackTime - StartAttackTime) / 2f))
         {
             CharacterControl control = characterState.GetCharacterControl(animator);
             if (control.Attack)
             {
                 //Debug.Log("uppercut triggered");
                 animator.SetBool(TransitionParameter.Attack.ToString(), true);
             }
         }
     }
 }
        public override void UpdateAbility(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl control = characterState.GetCharacterControl(animator);

            if (stateInfo.normalizedTime >= CheckTime)
            {
                if (IsGrounded(control))
                {
                    animator.SetBool(TransitionParameter.Grounded.ToString(), true);
                }
                else
                {
                    animator.SetBool(TransitionParameter.Grounded.ToString(), false);
                }
            }
        }
Example #5
0
        public override void UpdateAbility(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl control = characterState.GetCharacterControl(animator);

            if (control.Jump)
            {
                animator.SetBool(TransitionParameter.Jump.ToString(), true);
            }

            if (Constant)
            {
                ConstantMove(control, animator, stateInfo);
            }
            else
            {
                ControlledMove(control, animator, stateInfo);
            }
        }
        public override void UpdateAbility(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl control = characterState.GetCharacterControl(animator);

            if (control.Jump)
            {
                animator.SetBool(TransitionParameter.Jump.ToString(), true);
            }

            if (control.MoveRight)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), true);
            }

            if (control.MoveLeft)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), true);
            }
        }
        bool IsGrounded(CharacterControl control)
        {
            if (control.RIGID_BODY.velocity.y > -0.01f && control.RIGID_BODY.velocity.y <= 0f)
            {
                return(true);
            }

            foreach (GameObject o in control.BottomSpheres)
            {
                Debug.DrawRay(o.transform.position, -Vector3.up * 0.7f, Color.yellow);
                RaycastHit hit;
                if (Physics.Raycast(o.transform.position, -Vector3.up, out hit, Distance))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #8
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))
                {
                    if (!control.RagdollParts.Contains(hit.collider))
                    {
                        if (IsBodyPart(hit.collider))
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Example #9
0
        bool IsBodyPart(Collider col)
        {
            CharacterControl control = col.transform.root.GetComponent <CharacterControl>();

            if (control == null)
            {
                return(false);
            }

            if (control.gameObject == col.gameObject)
            {
                return(false);
            }

            if (control.RagdollParts.Contains(col))
            {
                return(true);
            }

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

            Debug.Log(control.MoveForward);
            if (control.MoveRight && control.MoveLeft && control.MoveForward)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), false);
                return;
            }

            if (!control.MoveRight && !control.MoveLeft && !control.MoveForward)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), false);
                return;
            }
            if (control.MoveForward)
            {
                control.transform.Translate(Vector3.forward * Speed * Time.deltaTime);
                //control.transform.rotation = Quaternion.Euler(0f, 0f, 0f); // change direction forward
            }
            if (control.MoveRight)
            {
                //Debug.Log(control.MoveForward);
                control.transform.Translate(Vector3.right * Speed * Time.deltaTime);
                //control.transform.rotation = Quaternion.Euler(0f, 0f, 0f); // change direction forward
            }



            if (control.MoveLeft)
            {
                control.transform.Translate(Vector3.left * Speed * Time.deltaTime);
                //control.transform.rotation = Quaternion.Euler(0f, 180f, 0f); // change direction backward
            }
        }
        private void OnTriggerEnter(Collider col)
        {
            if (owner.RagdollParts.Contains(col))
            {
                return;
            }

            CharacterControl attacker = col.transform.root.GetComponent <CharacterControl>();

            if (attacker == null)
            {
                return;
            }

            if (col.gameObject == attacker.gameObject)
            {
                return;
            }

            if (!CollidingParts.Contains(col))
            {
                CollidingParts.Add(col);
            }
        }
Example #12
0
 private void Awake()
 {
     control = GetComponent <CharacterControl>();
 }
 private void Awake()
 {
     characterControl = this.gameObject.GetComponent <CharacterControl>();
 }
Example #14
0
        private void SpawnObj(CharacterControl control)
        {
            if (control.ap.PoolObjectList.Contains(ObjectType))
            {
                return;
            }

            Debug.Log("Spawning " + ObjectType.ToString() + "|||||||||||||| Looking for: " + ParentObjectName);

            GameObject obj = PoolManager.Instance.GetObject(ObjectType);

            if (!string.IsNullOrEmpty(ParentObjectName))
            {
                GameObject p;

                if (control.GetChildObj(ParentObjectName) == null)
                {
                    p = GameObject.Find(ParentObjectName);
                }
                p = control.GetChildObj(ParentObjectName);
                obj.transform.parent        = p.transform;
                obj.transform.localPosition = Vector3.zero;
                obj.transform.localRotation = Quaternion.identity;
            }

            if (Throwable)
            {
                Rigidbody rb = obj.GetComponent <Rigidbody>();
                obj.transform.localPosition = Vector3.zero;
                obj.transform.localRotation = Quaternion.identity;


                if (obj.transform.root.GetComponent <CharacterControl>().FaceLeft)
                {
                    rb.velocity = -Vector3.forward * Speed;
                }
                else
                {
                    rb.velocity = Vector3.forward * Speed;
                }
                obj.transform.parent = null;
            }

            if (Explosive)
            {
                obj.transform.parent = GameObject.Find(ExplosiveParent).transform;
            }

            if (!StickToParent)
            {
                obj.transform.localPosition = Vector3.zero;
                obj.transform.parent        = null;
                obj.transform.localRotation = Quaternion.identity;
            }

            if (OffsetRot)
            {
                obj.transform.rotation = rotation;
            }



            obj.SetActive(true);

            control.ap.PoolObjectList.Add(ObjectType);
        }
 private void Awake()
 {
     control = GetComponent <CharacterControl>();
     HP      = 0.0f;
     Stocks  = 3;
 }
Example #16
0
 private void TGOff(CharacterControl control)
 {
     control.RIGID_BODY.velocity   = Vector3.zero;
     control.RIGID_BODY.useGravity = On;
 }
        public override void OnExit(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl control = characterState.GetCharacterControl(animator);

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

            control.GravityMultiplier = Gravity.Evaluate(stateInfo.normalizedTime);
        }
Example #19
0
 public void Awake()
 {
     control   = GetComponentInParent <CharacterControl>();
     pressTime = 0f;
 }
 private void Awake()
 {
     owner = this.GetComponentInParent <CharacterControl>();
 }
Example #21
0
        public void SpawnPlayers(PCT one, PCT two)
        {
            string objName = "";

            switch (one)
            {
            case PCT.NONE:
            {
                objName = "Evan";
            }
            break;

            case PCT.MATEO:
            {
                objName = "Mateo";
            }
            break;

            case PCT.EVAN:
            {
                objName = "Evan";
            }
            break;

            case PCT.WILLEN:
            {
                objName = "Mateo";
            }
            break;

            case PCT.NOAH:
            {
                objName = "Mateo";
            }
            break;

            case PCT.BRENDAN:
            {
                objName = "Mateo";
            }
            break;

            case PCT.CAMERON:
            {
                objName = "Mateo";
            }
            break;

            case PCT.IAN:
            {
                objName = "Mateo";
            }
            break;

            case PCT.RANDOM:
            {
                objName = "Mateo";
            }
            break;
            }

            GameObject obj = Instantiate(Resources.Load(objName, typeof(GameObject)) as GameObject);;

            obj.transform.position = this.transform.position;
            this.GetComponent <MeshRenderer>().enabled = false;

            pOne = obj.GetComponent <CharacterControl>();
            d.GetComponent <UIDamageText>().dd = pOne;
            s.GetComponent <UIStocksText>().cc = pOne;
            //s.GetComponent<UIStocksText>().dd = obj.GetComponent<DamageDetector>();

            GameObject.Find("Targetgroup").GetComponent <CinemachineTargetGroup>().AddMember(obj.transform, 1, 0);

            obj.GetComponentInChildren <FollowPlayer>().uiArrow = GameObject.Find("Image GREEN").GetComponent <Image>();
            obj.GetComponent <ManualInput>().enabled            = true;
            obj.GetComponent <ManualInputTwo>().enabled         = false;
        }