// Use this for initialization
 protected virtual void Start()
 {
     rgbd          = GetComponent <Rigidbody2D>();
     sceneAnimator = FindObjectOfType <SceneAnimator>();
     InitializeParticles();
     alreadyEnteredParticleZone = false;
 }
Exemple #2
0
    public void TogglePowerableAnimatorsWithName(string animatorParameter, bool value, string name)
    {
        GameObject    gameObject    = GameObject.Find(name);
        SceneAnimator sceneAnimator = FindObjectOfType <SceneAnimator>();

        sceneAnimator.SetBool(animatorParameter, value, gameObject);
    }
    protected virtual void Start()
    {
        sceneAnimator = FindObjectOfType <SceneAnimator>();
        levelManager  = FindObjectOfType <LevelManager>();
        rb2d          = GetComponent <Rigidbody2D>();
        InitializeParticles();
        maged             = false;
        deathIsComing     = false;
        ignoresCollisions = new Dictionary <string, bool> {
            { "Verde", false }, { "Rojo", false }, { "Amarillo", false }
        };

        currentPatrolPointCount = 0;

        if (patrollingSpeed.Equals(default(float)))
        {
            Debug.LogError("This Enemy has no speed set");
        }

        patrollingSpeed = patrollingSpeed * 0.04f;
        directionX      = -1;
        hp = maxHp;

        if (patrollingPoints != null && patrollingPoints.Length > 0)
        {
            NextPatrollingPoint();
        }
    }
Exemple #4
0
 protected void ChangeLavaSpritesIntoWater(bool isWater)
 {
     GameObject[] changableLavas = GameObject.FindGameObjectsWithTag("ChangableLava" + id);
     foreach (GameObject changableLava in changableLavas)
     {
         SceneAnimator sAnimator = FindObjectOfType <SceneAnimator>();
         sAnimator.SetBool("isWater", isWater, changableLava);
     }
 }
Exemple #5
0
 // Use this for initialization
 protected virtual void Start()
 {
     yetNeeded             = true;
     dontAcceptMorePlayers = false;
     currentDistance       = 0;
     maxDistance           = 6f;
     targetsReached        = 0;
     sceneAnim             = FindObjectOfType <SceneAnimator>();
     levelManager          = FindObjectOfType <LevelManager>();
     playerControllers     = new PlayerController[3];
 }
    public void Fall()
    {
        PolygonCollider2D collider = GetComponent <PolygonCollider2D>();

        collider.enabled = true;
        Debug.Log("Got Collider and activated it");

        SceneAnimator sceneAnimator = GameObject.FindObjectOfType <SceneAnimator>();

        sceneAnimator.SetBool("RockBottom", true, this.gameObject);
        Debug.Log("Got Sceneanimator and animated " + gameObject.name);
    }
Exemple #7
0
    protected virtual void Start()
    {
        sceneAnimator = FindObjectOfType <SceneAnimator>();

        if (!sceneAnimator)
        {
            Debug.LogError(name + " did not found the SceneAnimator");
        }

        levelManager = FindObjectOfType <LevelManager>();
        mainCamera   = FindObjectOfType <CameraController>().gameObject;
        rb2d         = GetComponent <Rigidbody2D>();

        respawnPosition = transform.position;

        attackAnimName = "Attacking";

        controlOverEnemies = false;
        canAccelerate      = false;
        isAttacking        = false;
        localPlayer        = false;
        isGrounded         = false;
        mpDepleted         = false;
        isPowerOn          = false;
        connected          = true;
        canMove            = true;
        justJumped         = false;
        availableChatZone  = null;
        decisionName       = null;
        availablePowerable = null;
        gravityPower       = 2.3f;

        remoteAttacking = false;
        remoteJumping   = false;
        remoteRight     = false;
        remoteLeft      = false;
        remoteUp        = false;

        actualFramesForPowerCheck = 0;
        mpUpdateFrame             = 0;
        acceleration = 0f;
        sortingOrder = 0;
        directionY   = 1;
        directionX   = 1;
        debuger      = 0;


        SetPositiveGravity(true);
        InitializeParticles();
        IgnoreCollisionWithObjectsWhoHateMe();
        IgnoreCollisionBetweenPlayers();
    }
Exemple #8
0
    public void PowerableToggleLavaIntoWater(string parameter, bool value, int damagingId)
    {
        LavaIntoWaterIdentifier[] lavas         = FindObjectsOfType <LavaIntoWaterIdentifier>();
        SceneAnimator             sceneAnimator = FindObjectOfType <SceneAnimator>();

        foreach (LavaIntoWaterIdentifier lava in lavas)
        {
            if (lava.id == damagingId)
            {
                sceneAnimator.SetBool(parameter, value, lava.gameObject);
            }
        }
    }
    protected virtual void Start()
    {
        sceneAnimator = GameObject.FindObjectOfType <SceneAnimator>();

        if (!sceneAnimator)
        {
            Debug.Log(name + " did not found the SceneAnimator");
        }

        levelManager = FindObjectOfType <LevelManager>();
        rb2d         = GetComponent <Rigidbody2D>();

        respawnPosition = transform.position;

        attackAnimName = "Attacking";

        controlOverEnemies = false;
        canAccelerate      = false;
        isAttacking        = false;
        localPlayer        = false;
        isGrounded         = false;
        mpDepleted         = false;
        isPowerOn          = false;
        conectado          = true;
        canMove            = true;
        gravity            = true;

        remoteAttacking = false;
        remoteJumping   = false;
        remoteRight     = false;
        remoteLeft      = false;
        remoteUp        = false;

        mpUpdateFrame = 0;
        acceleration  = 0f;
        sortingOrder  = 0;
        directionY    = 1;
        directionX    = 1;
        debuger       = 0;

        SetGravity(gravity);
        InitializeParticles();
        IgnoreCollisionBetweenPlayers();
    }
Exemple #10
0
    protected virtual void Start()
    {
        animControl  = GameObject.FindObjectOfType <SceneAnimator>();
        levelManager = FindObjectOfType <LevelManager>();
        rb2d         = GetComponent <Rigidbody2D>();

        ignoresCollisions = new Dictionary <string, bool> {
            { "Mage", false }, { "Warrior", false }, { "Engineer", false }
        };

        currentPatrolPointCount = 0;
        patrollingSpeed         = 0.005f;
        directionX = -1;
        hp         = maxHp;

        if (patrollingPoints != null && patrollingPoints.Length > 0)
        {
            NextPatrollingPoint();
        }
    }
Exemple #11
0
    public void ChangeLavaIntoWater(bool boolValue)
    {
        LavaIntoWaterIdentifier[] changeableLavas = FindObjectsOfType <LavaIntoWaterIdentifier>();

        foreach (LavaIntoWaterIdentifier lava in changeableLavas)
        {
            if (id == lava.id)
            {
                SceneAnimator sAnimator = FindObjectOfType <SceneAnimator>();
                sAnimator.SetBool("WaterFalling", boolValue, lava.gameObject);
                StartCoroutine(WaitForLavaAnimator());
            }
        }

        if (boolValue)
        {
            turnedIntoWater = true;
        }
        else if (boolValue == false)
        {
            turnedIntoWater = false;
        }
    }
Exemple #12
0
    public void StartAnimatorBool(string parameter, bool value, GameObject gameObject)
    {
        SceneAnimator sceneAnimator = FindObjectOfType <SceneAnimator>();

        sceneAnimator.SetBool(parameter, value, gameObject);
    }
    protected void SetAnimatorBool(string parameter, bool value, ActivableSystem activableSystem, float time)
    {
        SceneAnimator sceneAnimator = GameObject.FindObjectOfType <SceneAnimator>();

        sceneAnimator.SetBool(parameter, value, activableSystem.gameObject, time);
    }
    protected void StartAnimation(string animationName, ActivableSystem activableSystem)
    {
        SceneAnimator sceneAnimator = GameObject.FindObjectOfType <SceneAnimator>();

        sceneAnimator.StartAnimation(animationName, activableSystem.gameObject);
    }
Exemple #15
0
    public void Slide()
    {
        SceneAnimator sceneAnimator = GameObject.FindObjectOfType <SceneAnimator>();

        sceneAnimator.SetBool("caidaOn", true, this.gameObject);
    }