コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     lastFired = 0f;
     tankEntity.Initialize();
     rb               = GetComponent <Rigidbody2D>();
     player           = FindObjectOfType <PlayerController>().transform;
     itemSpawner      = FindObjectOfType <ItemSpawner>();
     gameObject.layer = LayerMask.NameToLayer("Enemy");
 }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        tankEntity.Initialize();
        isHolding = false;

        Physics2D.IgnoreLayerCollision(LayerMask.NameToLayer("Player"), LayerMask.NameToLayer("PlayerProjectile"));
        Physics2D.IgnoreLayerCollision(LayerMask.NameToLayer("Enemy"), LayerMask.NameToLayer("EnemyProjectile"));

        rb = GetComponent <Rigidbody2D>();

        ScrapsToAmmoButton.onClick.AddListener(ScrapsToAmmo);
        ScrapsToIronButton.onClick.AddListener(ScrapsToIron);
        IronToRepairButton.onClick.AddListener(IronToRepair);

        sceneLoader = FindObjectOfType <SceneLoader>();
    }