public void ShowLaunchInfo(CanonState tState, tagItemConfig itemConfig, byte tType) { _mState = tState; _mLaunchType = tType; _mImageIcon.sprite = ResManager.Instance.LoadSprite("BuYu/Texture/Gun/Icon/" + itemConfig.ItemIcon); _mTextTitle.text = itemConfig.ItemName; if (_mState == CanonState.Equiped) { _mUiButton.enabled = false; _mTextState.text = "已装备"; _mGoLocked.SetActive(false); } else if (_mState == CanonState.NoEquiped) { _mUiButton.enabled = true; _mTextState.text = "装备"; _mGoLocked.SetActive(false); } else { _mUiButton.enabled = true; _mTextState.text = "装备"; _mGoLocked.SetActive(true); } }
void UpdateCanonState() { if (!isLoaded) { currentCanonState = CanonState.EMPTY; } else { currentCanonState = CanonState.LOADED; } }
private void CheckForEnemies() { ObjectsInRange.RemoveAll(x => x == null); if (ObjectsInRange.Count > 0) { State = CanonState.ENEMY_FOUND; } else { State = CanonState.ENEMY_NOT_FOUND; } }
private void OnTriggerEnter2D(Collider2D collision) { if (doAction == DoActionVoid) { return; } CanonState canonState = collision.gameObject.GetComponent <CanonState>(); if (canonState && canonState.IsTriggered) { DestroyWithParticle(); } }