コード例 #1
0
 // Use this for initialization
 void Start()
 {
     rb            = GetComponent <Rigidbody2D>();
     animatorEnemy = GetComponent <Animator>();
     sprite        = GetComponent <Spriter2UnityDX.EntityRenderer>();
     player        = GameObject.Find("Player").GetComponent <Character>();
 }
コード例 #2
0
 private void Start()
 {
     // костыль для колчанов у лукарей, иначе отображаются выше леера юнитов :(
     Spriter2UnityDX.EntityRenderer entityRenderer = this.GetComponentInChildren <Spriter2UnityDX.EntityRenderer>();
     entityRenderer.ApplySpriterZOrder = false;
     entityRenderer.ApplySpriterZOrder = true;
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     animator = GetComponent <Animator>();
     EfirePos = transform.Find("EBulletPos");
     sprite   = GetComponent <Spriter2UnityDX.EntityRenderer>();
     player   = GameObject.Find("Player").GetComponent <Character>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     ren = GetComponent <Spriter2UnityDX.EntityRenderer>();
     GetComponent <BoxCollider2D>().isTrigger = false;
     anim     = GetComponent <Animator>();
     rb       = GetComponent <Rigidbody2D>();
     iniAlpha = ren.Color.a;
 }
コード例 #5
0
ファイル: BossController.cs プロジェクト: Wrexionth/ProyekUTS
 // Use this for initialization
 void Start()
 {
     rb            = GetComponent <Rigidbody2D>();
     animatorEnemy = GetComponent <Animator>();
     sprite        = GetComponent <Spriter2UnityDX.EntityRenderer>();
     player        = GameObject.Find("Player").GetComponent <Character>();
     interval      = 250;
     enemyHealth   = 100;
     animatorEnemy.Play("1_IDLE");
 }
コード例 #6
0
 private void Awake()
 {
     anim           = GetComponentInChildren <Animator>();
     TargetsInRange = new List <Transform>();
     movementSpeed  = EnemyData.MovementSpeed;
     attackStrength = EnemyData.AttackStrength;
     attackSpeed    = EnemyData.AttackSpeed;
     GetComponent <Health>().InitMaxHealth(EnemyData.Health);
     spriteRenderer = GetComponent <SpriteRenderer>();
     entityRenderer = GetComponent <Spriter2UnityDX.EntityRenderer>();
 }
コード例 #7
0
    // Use this for initialization


    void Start()
    {
        if (savepoint && SceneManager.GetSceneByName("Scenario2").isLoaded)
        {
            gameObject.transform.position = new Vector3(106.78f, -1.51f, 0f);
            savepoint = false;
        }
        Rigidbody2D = GetComponent <Rigidbody2D>();
        animator    = GetComponent <Animator>();
        sprite      = GetComponent <Spriter2UnityDX.EntityRenderer>();
        checkpoint.Add(new Vector3(40.76451f, -2.166512f, 0));
        checkpoint.Add(new Vector3(64.09798f, -2.13701f, 0));
        checkpoint.Add(new Vector3(23.74f, -2.56f, 0));
        checkpoint.Add(new Vector3(51.6f, -2.56f, 0));
        checkpoint.Add(new Vector3(111.8f, -2.56f, 0));
        health       = 100;
        gamefinished = false;
        firePos      = transform.Find("BulletPos");
        //StartCoroutine(StartMainStory());
    }
コード例 #8
0
    // Use this for initialization
    void Start()
    {
        ren = GetComponent <Spriter2UnityDX.EntityRenderer>();
        GetComponent <BoxCollider2D>().isTrigger = false;
        anim     = GetComponent <Animator>();
        rb       = GetComponent <Rigidbody2D>();
        iniAlpha = ren.Color.a;

        jumpSource      = gameObject.AddComponent <AudioSource>();
        jumpSource.clip = jumpSFX;
        landSource      = gameObject.AddComponent <AudioSource>();
        landSource.clip = landSFX;
        dieSource       = gameObject.AddComponent <AudioSource>();
        dieSource.clip  = dieSFX;
        winSource       = gameObject.AddComponent <AudioSource>();
        winSource.clip  = winSFX;

        audioList = GetComponents <AudioSource>();
        foreach (AudioSource audio in audioList)
        {
            audio.volume      = PlayerPrefs.GetFloat("SFXvolume");
            audio.playOnAwake = false;
        }
    }