Exemple #1
0
        public void SetAllocate(Sefira currentSefira)
        {
            if (currentSefira == null)
            {
                ui.Allocate.image.sprite = allocate_normal;
                SpriteState sets = ui.Allocate.spriteState;
                sets.highlightedSprite  = allocate_overlay;
                sets.disabledSprite     = allocate_normal;
                sets.pressedSprite      = allocate_overlay;
                ui.Allocate.spriteState = sets;

                return;
            }
            if (currentSefira.name == SefiraName.Malkut)
            {
                ui.Allocate.image.sprite = allocate_malkut;
                SpriteState sets = ui.Allocate.spriteState;
                sets.highlightedSprite  = allocate_malkut;
                sets.disabledSprite     = allocate_malkut;
                sets.pressedSprite      = allocate_malkut;
                ui.Allocate.spriteState = sets;
            }
            else if (currentSefira.name == SefiraName.Yesod)
            {
                ui.Allocate.image.sprite = allocate_yesod;
                SpriteState sets = ui.Allocate.spriteState;
                sets.highlightedSprite  = allocate_yesod;
                sets.disabledSprite     = allocate_yesod;
                sets.pressedSprite      = allocate_yesod;
                ui.Allocate.spriteState = sets;
            }
        }
Exemple #2
0
 public void SetSprites(Sefira sefira)
 {
     if (sefira.name == SefiraName.Malkut)
     {
         this.spriteTarget.SpriteSet(this.malkuth);
     }
     else if (sefira.name == SefiraName.Yesod)
     {
         this.spriteTarget.SpriteSet(this.yessod);
     }
 }
Exemple #3
0
 public void OnAllocateClick()
 {
     if (this.allocatedIndex != -1)
     {
         //Debug.Log("Cancel agent allocated");
         SefiraAgentSlot.instance.CancelSefiraAgent(this.model, allocatedIndex);
         this.allocatedIndex = -1;
         sets.SetAllocate(null);
         return;
     }
     //Debug.Log("Allocate agent");
     StageUI.instance.SetAgentSefriaButton(this.model);
     currentAgentSefira = SefiraManager.instance.GetSefira(model.currentSefira);
     //Debug.Log(currentAgentSefira);
     sets.SetAllocate(currentAgentSefira);
     //ui change
 }
Exemple #4
0
 public void SetSpriteInitial(bool promotionEnabled, Sefira currentSefira)
 {
     SetPromotion(promotionEnabled);
     SetAllocate(currentSefira);
 }
    public void Change(WorkerModel model)
    {
        spriteSet.SetSprite(model);
        Transform targetTransform = null;
        Sefira    targetSefria    = null;

        if ((targetSefria = SefiraManager.instance.GetSefira(model.currentSefira)) != null)
        {
            switch (targetSefria.name)
            {
            case "Malkut":
                if (model is AgentModel)
                {
                    current = malkutAgent;
                }
                else
                {
                    current = malkutOfficer;
                }
                break;

            default:
                current = malkutOfficer;
                break;
            }
        }

        if (model is AgentModel)
        {
            agentUnit = AgentLayer.currentLayer.GetAgent(model.instanceId);
            if (officerUnit != null)
            {
                officerUnit.gameObject.SetActive(false);
            }
            unit            = agentUnit;
            targetTransform = (unit as AgentUnit).gameObject.transform;
            //(unit as AgentUnit).blockMoving = true;
            //model.movableNode = this.movableObject;
        }
        else if (model is OfficerModel)
        {
            officerUnit = OfficerLayer.currentLayer.GetOfficer(model.instanceId);
            if (agentUnit != null)
            {
                agentUnit.gameObject.SetActive(false);
            }
            unit            = officerUnit;
            targetTransform = (unit as OfficerUnit).gameObject.transform;
        }
        level1SpriteRenderer.SetSprite(current);
        //targetTransform.SetParent(this.transform, true);

        /*
         * targetTransform.localPosition = reference.localPosition;
         * targetTransform.localScale = reference.localScale;
         * targetTransform.localRotation = reference.localRotation;
         */
        /*
         * targetTransform.localPosition = Vector3.zero;
         * targetTransform.localScale = new Vector3(5, 5, 1);
         * targetTransform.localRotation = Quaternion.identity;
         */
    }
Exemple #6
0
    public static SuppressWindow CreateNullCreatureSuppressWindow(CreatureModel nullCreature, WorkerModel model)
    {
        Debug.Log("NullCreature Suppress");
        if (currentWindow.gameObject.activeSelf)
        {
            if (currentWindow.target == model)
            {
                return(currentWindow);
            }
        }
        else
        {
            currentWindow.gameObject.SetActive(true);
            currentWindow.line.gameObject.SetActive(true);
            currentWindow.Activate();
        }

        SuppressWindow inst = currentWindow;

        inst.target = model;
        if (model is AgentModel)
        {
            inst.targetType = TargetType.AGENT;
        }
        else if (model is OfficerModel)
        {
            inst.targetType = TargetType.OFFICER;
        }
        Sefira modelSefira = nullCreature.sefira;

        if (inst.currentSefira != modelSefira)
        {
            inst.currentSefira = modelSefira;
            inst.agentList.Clear();
            inst.SetSprites(modelSefira);
        }
        inst.InitAgentList();
        inst.ShowAgentList();

        CreatureUnit unit = CreatureLayer.currentLayer.GetCreature(nullCreature.instanceId);

        if (model is AgentModel)
        {
            AgentUnit agentUnit = AgentLayer.currentLayer.GetAgent(model.instanceId);
            inst.attachedPos = agentUnit.transform;
            inst.ui.Init(nullCreature, TargetType.CREATURE);
        }
        else if (model is OfficerModel)
        {
            OfficerUnit officerUnit = OfficerLayer.currentLayer.GetOfficer(model.instanceId);
            inst.attachedPos = officerUnit.transform;
            inst.ui.Init(nullCreature, TargetType.CREATURE);
        }


        if (inst.activatableObjectInitiated == false)
        {
            inst.UIActivateInit();
        }

        Canvas canvas = inst.transform.GetChild(0).GetComponent <Canvas>();

        canvas.worldCamera = UIActivateManager.instance.GetCam();
        currentWindow      = inst;
        Debug.Log("Null Creature's Window Opened");
        return(inst);
    }