Exemplo n.º 1
0
    // Use this for initialization
    private void Start()
    {
        textmgr = GameObject.Find("TextManager").GetComponent <TextManager>();
        textmgr.setEffect(new TwitchEffect(textmgr));
        encounter = FindObjectOfType <LuaEnemyEncounter>();

        fightBtn        = GameObject.Find("FightBt").GetComponent <Image>();
        fightBtn.sprite = SpriteRegistry.Get("UI/Buttons/fightbt_0");
        actBtn          = GameObject.Find("ActBt").GetComponent <Image>();
        actBtn.sprite   = SpriteRegistry.Get("UI/Buttons/actbt_0");
        itemBtn         = GameObject.Find("ItemBt").GetComponent <Image>();
        itemBtn.sprite  = SpriteRegistry.Get("UI/Buttons/itembt_0");
        mercyBtn        = GameObject.Find("MercyBt").GetComponent <Image>();
        mercyBtn.sprite = SpriteRegistry.Get("UI/Buttons/mercybt_0");

        ArenaSizer.instance.ResizeImmediate(ArenaSizer.UIWidth, ArenaSizer.UIHeight);
        PlayerController.instance.setControlOverride(true);
        fightUI = GameObject.Find("FightUI").GetComponent <FightUIController>();
        fightUI.gameObject.SetActive(false);

        bindEncounterScriptInteraction();
        encounter.CallOnSelfOrChildren("EncounterStarting");
        if (state == UIState.NONE)
        {
            SwitchState(UIState.ACTIONSELECT);
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        StationaryMissScript _smc = Resources.Load <StationaryMissScript>("Prefabs/StationaryMiss");

        if (_smc != null && _smc.ToString().ToLower() != "null")
        {
            smc = _smc;
        }
        GameObject go = Resources.Load <GameObject>("Prefabs/FightInstance");

        if (go != null && go.ToString().ToLower() != "null")
        {
            FightInstance = go;
        }
        line.Set("UI/Battle/spr_targetchoice_0");
        instance = this;
    }
Exemplo n.º 3
0
 private void Start()
 {
     line.Set("UI/Battle/spr_targetchoice_0");
     instance = this;
 }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     base.Start();
     isOnTurn = false;
     if (powerIndicator == null)
     {
         try{
             powerIndicator = GameObject.Find("PowerIndicator").GetComponent <Slider>();
         } catch (Exception e) {
         }
     }
     if (prevPowerIndicator == null)
     {
         try{
             prevPowerIndicator = GameObject.Find("PreviousPowerIndicator").GetComponent <Slider>();
         } catch (Exception e) {
         }
     }
     // angleIndicatorAnchor = transform.GetChild(2).GetComponent<Transform>().position;
     // angleIndicator = transform.GetChild(1).GetComponent<Transform>();
     if (handRotator == null)
     {
         try{
             handRotator = GameObject.Find("AngleHand").GetComponent <HandRotator>();
         } catch (Exception e) {
         }
     }
     if (uiController == null)
     {
         try{
             uiController = GameObject.Find("UIController").GetComponent <FightUIController>();
         } catch (Exception e) {
         }
     }
     handRotator.SetIsHeadRight(this.isHeadingRight);
     // try {
     //     virtualRigidBody = GameObject.Find("VirtualRigidbody").GetComponent<VirtualRigidbodyHandler>();
     // } catch(Exception e){
     //     Debug.Log("Err: "+ e);
     // }
     indicatorRotator = this.FindChildObject("AngleIndicator");
     angleIndicator   = indicatorRotator.GetComponent <AngleIndicatorController>();
     angleBackground  = this.FindChildObject("AngleBackground");
     fightInfoDisplay = GameObject.Find("PlayerFightInfo").GetComponent <PlayerFightInfoDisplay>();
     // if (virtualRigidBody != null){
     //     Debug.Log("VRB != NULL");
     //     Destroy(virtualRigidBody.gameObject);
     // } else {
     // }
     // GameObject vrb = Instantiate(virtualRigidbodyPrefab,this.transform.position,Quaternion.identity);
     // virtualRigidBody = vrb.GetComponent<VirtualRigidbodyHandler>();
     // virtualRigidBody.mpc = this;
     isHeadingRight = (this.transform.rotation.eulerAngles.x < 179f);
     // moveSlowMultiply  = new Vector2(0.8f,0f);
     // fireAngle = 20;
     // handRotator.SetAngle(fireAngle);
     firePower = 0;
     timer     = 0f;
     // rigidBody.simulated = true;
     //anim = transform.GetChild(1).gameObject.GetComponent<Animator>();
 }