示例#1
0
    public override void Attached()
    {
        CoopAnimal componentInChildren = base.GetComponentInChildren <CoopAnimal>();

        if (!componentInChildren)
        {
            return;
        }
        if (componentInChildren._animator)
        {
            componentInChildren._animator.applyRootMotion = false;
        }
        if (componentInChildren.rotationTransform)
        {
            base.state.TransformPosition.SetTransforms(base.transform);
            base.state.TransformRotation.SetTransforms(componentInChildren.rotationTransform);
        }
        else
        {
            base.state.TransformFull.SetTransforms(base.transform);
        }
        CoopComponentDisabler exists = base.GetComponent <CoopComponentDisabler>();

        if (!exists)
        {
            exists = base.gameObject.AddComponent <CoopComponentDisabler>();
        }
    }
示例#2
0
    public override void Attached()
    {
        CoopAnimal componentInChildren = base.GetComponentInChildren <CoopAnimal>();

        if (componentInChildren.rotationTransform)
        {
            base.state.TransformPosition.SetTransforms(base.transform);
            base.state.TransformRotation.SetTransforms(componentInChildren.rotationTransform);
        }
        else
        {
            base.state.TransformFull.SetTransforms(base.transform);
        }
    }
示例#3
0
 public override void OnEvent(syncAnimalState evnt)
 {
     if (!this.ValidateSender(evnt, SenderTypes.Any))
     {
         return;
     }
     if (evnt.target)
     {
         CoopAnimal componentInChildren = evnt.target.GetComponentInChildren <CoopAnimal>();
         if (componentInChildren)
         {
             componentInChildren.setOnSnow(evnt.onSnow);
         }
     }
 }
示例#4
0
    private void Awake()
    {
        mutantAI_net component = base.transform.GetComponent <mutantAI_net>();

        if (component && component.creepy_boss)
        {
            base.enabled = false;
            return;
        }
        if (base.entity && base.entity.isAttached)
        {
            CoopAnimal componentInChildren = base.transform.GetComponentInChildren <CoopAnimal>();
            if (componentInChildren && componentInChildren.birdType)
            {
                UnityEngine.Object.Destroy(this);
            }
            foreach (Renderer item in base.entity.GetComponentsInChildren <Renderer>())
            {
                this.Renderers.Add(item);
            }
            foreach (Collider item2 in base.entity.GetComponentsInChildren <Collider>())
            {
                this.Colliders.Add(item2);
            }
            if (!this.animator)
            {
                this.animator = base.entity.GetComponentInChildren <Animator>();
            }
            if (base.entity.isFrozen)
            {
                this.DisableComponents();
            }
            else
            {
                this.EnableComponents();
            }
        }
    }