Пример #1
0
    private void InitializeShadow()
    {
        /*Find the shadow and the character movement script component*/
        shadow           = transform.Find("Shadow").gameObject;
        shadowMoveScript = shadow.GetComponent <CharacterMovements>();
        GameDebug.AssertInTransform(shadow != null && shadowMoveScript != null, transform, "There must be a gameObject named \"shadow\" with a CharacterMovements");

        /*Initialize shadow movement script*/
        shadowMoveScript.properties = shadowProperties.movementProperties;
        shadowMoveScript.audio      = shadowProperties.audioComponent;

        /*Find the animator component*/
        shadowAnimator            = shadow.transform.Find("body").GetComponent <Animator>();
        shadowMoveScript.animator = shadowAnimator;
        GameDebug.AssertInTransform(shadowAnimator != null, shadow.transform, "There must be a gameObject named \"body\" with a Animator");


        if (shadowProperties.movementProperties.avoidSlowMotion)
        {
            float multiplicator = 1f / GameObject.Find("Manager/TimeManager").GetComponent <TimeManager>().getTimeScaleInFirstPlanWhenSwitch();

            shadowProperties.movementProperties.scaleMotion(multiplicator);
        }

        if (shadowProperties.activateShadowOnStart)
        {
            EnableShadow();
        }
        else
        {
            DisableShadow();
        }
    }
Пример #2
0
 public void CopyFrom(CharacterMovements other)
 {
     JumpFlag      = other.JumpFlag;
     inputSpeed    = other.inputSpeed;
     isOnWall      = other.isOnWall;
     moveDirection = other.moveDirection;
 }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     /*
      *      cm = this.transform.GetChild(0).GetComponent<CharacterMovements>();
      *      cg = this.transform.GetChild(0).GetComponent<CharacterGraphics>();
      *      thr = this.transform.GetChild(0).GetComponent<Throwing>();
      */
     cm  = transform.GetComponent <CharacterMovements>();
     thr = transform.GetComponent <BombingActionMoves>();
     //cg = transform.GetComponent<CharacterGraphics>();
 }
Пример #4
0
    private void InitializeBody()
    {
        /*Find the body and the character movement script component*/
        body           = transform.Find("Body").gameObject;
        bodyMoveScript = body.GetComponent <CharacterMovements>();
        GameDebug.AssertInTransform(body != null && bodyMoveScript != null, transform, "There must be a gameObject named \"Body\" with a CharacterMovements");

        /*Initialize body movement script*/
        bodyMoveScript.properties = bodyProperties.movementProperties;
        bodyMoveScript.audio      = bodyProperties.audioComponent;

        /*Find the animator component*/
        bodyAnimator                  = body.transform.Find("body").GetComponent <Animator>();
        bodyMoveScript.animator       = bodyAnimator;
        bodyMoveScript.secondAnimator = shadowAnimator;
        GameDebug.AssertInTransform(bodyAnimator != null, body.transform, "There must be a gameObject named \"body\" with a Animator");

        if (bodyProperties.movementProperties.avoidSlowMotion)
        {
            float multiplicator = 1f / GameObject.Find("Manager/TimeManager").GetComponent <TimeManager>().getTimeScaleInFirstPlanWhenSwitch();

            bodyProperties.movementProperties.scaleMotion(multiplicator);
        }
    }
Пример #5
0
 void Start()
 {
     soundManager = GameObject.Find("RandomSoundManager").GetComponent <RandomSoundManager>();
     character    = GetComponent <CharacterMovements>();
     _probe       = new MidiProbe(MidiProbe.Mode.In);
 }