コード例 #1
0
ファイル: FightScreen.cs プロジェクト: aintech/Brooks_Star
    public FightScreen init(ScanningScreen scanningScreen, StatusScreen statusScreen, ItemDescriptor itemDescriptor)
    {
        this.scanningScreen = scanningScreen;
        this.playerData     = statusScreen.playerData;
        this.itemDescriptor = itemDescriptor;
        this.chambersHolder = statusScreen.cabin.chambersHolder;

        fightProcessor             = GetComponent <FightProcessor>();
        itemDescriptor.fightScreen = this;
        elementsHolder             = transform.Find("Elements Holder").GetComponent <ElementsHolder> ().init(this);;
        iconsHolderRender          = elementsHolder.GetComponent <SpriteRenderer>();
        fightEffectPlayer          = transform.Find("Fight Effect Player").GetComponent <FightEffectPlayer>().init();
        elementEffectPlayer        = transform.Find("ElementEffectPlayer").GetComponent <ElementEffectPlayer>();
        fightInterface             = transform.Find("Fight Interface").GetComponent <FightInterface>().init(this);
        enemy             = transform.Find("Enemy").GetComponent <Enemy>();
        resultScreen      = transform.Find("Fight Result Screen").GetComponent <FightResultScreen>().init(this, statusScreen.cabin.chambersHolder, enemy);
        enemyDeadAnimator = transform.Find("EnemyDeadAnim").GetComponent <Animator>();
        deadStone         = enemyDeadAnimator.transform.Find("DeadStone");
        enemyPos          = enemy.transform.localPosition;
//		elementsHolder.init();
        enemy.init(this);
        elementEffectPlayer.init(this, enemy);
        fightProcessor.init(this, elementsHolder, enemy);

        elementsHolder.gameObject.SetActive(true);
        enemyDeadAnimator.gameObject.SetActive(false);
        gameObject.SetActive(false);

        Transform actionsHolder = transform.Find("Actions Holder");

        actionsHolder.Find("Delimiter").GetComponent <StrokeText>().init("default", 5);
        playerActionsText = actionsHolder.Find("Player Actions").GetComponent <StrokeText>().init("default", 5);
        enemyActionsText  = actionsHolder.Find("Enemy Actions").GetComponent <StrokeText>().init("default", 5);
        actionsHolder.gameObject.SetActive(true);

        Transform  supplyHolder = transform.Find("Supply Holder");
        SupplySlot slot;

        for (int i = 0; i < supplyHolder.childCount; i++)
        {
            slot = supplyHolder.GetChild(i).GetComponent <SupplySlot>();
            slot.init();
            supplySlots.Add(slot);
        }
        supplyHolder.gameObject.SetActive(true);

        captureBtn = transform.Find("Capture Button").GetComponent <Button> ().init();
        releaseBtn = transform.Find("Release Button").GetComponent <Button> ().init();

        Player.fightScreen = this;

        return(this);
    }
コード例 #2
0
    public ScanningDetails init(ScanningScreen scanningScreen)
    {
        this.scanningScreen = scanningScreen;

        enemyImage = transform.Find("Enemy Image").GetComponent <SpriteRenderer>();
        enemyName  = transform.Find("Name").GetComponent <StrokeText>().init("default", 5);
        attackBtn  = transform.Find("Attack Button").GetComponent <Button>().init();
        retreatBtn = transform.Find("Retreat Button").GetComponent <Button>().init();

        gameObject.SetActive(false);

        return(this);
    }
コード例 #3
0
ファイル: ExploreScreen.cs プロジェクト: aintech/Brooks_Star
    public ExploreScreen init(PlanetSurface planetSurface, StatusScreen statusScreen, ItemDescriptor itemDescriptor)
    {
        this.planetSurface = planetSurface;
        enemyImage         = transform.Find("Enemy Image").GetComponent <SpriteRenderer>();

        exploreBtn = transform.Find("Explore Button").GetComponent <Button>().init();
        leaveBtn   = transform.Find("Leave Button").GetComponent <Button>().init();

        scanningScreen = GameObject.Find("Scanning Screen").GetComponent <ScanningScreen>().init(this, statusScreen, itemDescriptor);

        gameObject.SetActive(false);

        return(this);
    }
コード例 #4
0
    public EnemyBlock init(ScanningScreen scanningScreen)
    {
        this.scanningScreen = scanningScreen;
        portrait            = transform.Find("Portrait").GetComponent <SpriteRenderer>();
        enemyName           = transform.Find("Name").GetComponent <StrokeText>().init("default", 3);
        attackBtn           = transform.Find("Attack Button").GetComponent <Button>().init();
        fightResult         = transform.Find("Fight Result Text").GetComponent <TextMesh>();

        MeshRenderer mesh = fightResult.GetComponent <MeshRenderer>();

        mesh.sortingOrder     = portrait.sortingOrder;
        mesh.sortingLayerName = portrait.sortingLayerName;
        fightResult.gameObject.SetActive(false);

        gameObject.SetActive(false);
        return(this);
    }