コード例 #1
0
ファイル: SpiderScript.cs プロジェクト: Ggabrielnunes/MagoImp
    public override void Start()
    {
        anim        = GetComponent <Animator> ();
        rb2D        = GetComponent <Rigidbody2D>();
        soundsource = GetComponent <AudioSource>();
        Pl          = GameObject.FindWithTag("Player");
        mur         = Pl.gameObject.GetComponent <Player> ();

        Spw        = GameObject.FindWithTag("SpawnObj");
        Spw_Script = Spw.gameObject.GetComponent <Spawner>();

        bloodsp   = Resources.Load("Enemies/blood") as GameObject;
        dmgToWall = Resources.Load("WallDamage") as GameObject;

        vida        = 500.0f;
        walkingTime = 1.5f;
        Pont        = 100.0f;
        attack      = 40.0f;
        atkSpeed    = 0f;

        moving  = true;
        pAtacar = true;

        Direction  = 0;
        enemyPress = 20;
        isSlowed   = false;

        if (Application.platform == RuntimePlatform.Android)
        {
            StartingSpeed.Set(0.0f, 5f);
        }
        else
        {
            StartingSpeed.Set(0.0f, 10.0f);
        }

        speed = StartingSpeed;

        Spw_Script.setPress(enemyPress);
    }
コード例 #2
0
    public override void Start()
    {
        anim        = GetComponent <Animator>();
        rb2D        = GetComponent <Rigidbody2D>();
        soundsource = GetComponent <AudioSource>();

        Pl  = GameObject.FindWithTag("Player");
        mur = Pl.gameObject.GetComponent <Player>();

        Spw        = GameObject.FindWithTag("SpawnObj");
        Spw_Script = Spw.gameObject.GetComponent <Spawner>();


        bloodsp = Resources.Load("Enemies/blood") as GameObject;


        vida   = 80.0f;
        attack = 100.0f;
        Pont   = 50.0f;

        enemyPress = 10;
        isSlowed   = false;
        moving     = true;

        if (Application.platform == RuntimePlatform.Android)
        {
            StartingSpeed.Set(0.0f, 8f);
        }
        else
        {
            StartingSpeed.Set(0.0f, 45.0f);
        }

        speed = StartingSpeed;

        Spw_Script.setPress(enemyPress);
    }