コード例 #1
0
ファイル: SetShipView.cs プロジェクト: Daloupe/Syzygy_Git
    void SetSlot(GameObject slotObject, ShipComponentDatablock target, bool setBackgroundtexture = true)
    {
        var itemSlot = slotObject.GetComponent<UIItemSlot>();
        if (target == null)
        {
            if (itemSlot == null) return;

            itemSlot.Assign(container.SlotEmptyTexture);
            return;
        }

        PlayMakerFSM.FindFsmOnGameObject(slotObject, "FSM").FsmVariables.FindFsmObject("ComponentObject").Value = target;
        var slotImages = slotObject.GetComponentsInChildren<Image>();
        slotImages[1].sprite = Sprite.Create(target.Icon, new Rect(0, 0, target.Icon.width, target.Icon.height), new Vector2(0.5f, 0.5f));
        slotImages[1].color = Color.white;
        if(setBackgroundtexture) slotImages[0].sprite = container.SlotFilledTexture;
        slotImages[0].color = Color.white;

        if (itemSlot == null) return;

        itemSlot.hoverNormalColor = Color.white;
        itemSlot.hoverHighlightColor = container.SlotFilledHoverColor;
        itemSlot.SetIcon(container.SlotFilledTexture);
        itemSlot.hoverTargetGraphic.color = Color.white;
        itemSlot.OnPointerExit(null);
    }
コード例 #2
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public ComponentSlot(ShipComponentDatablock script)
 {
     ChangeComponent(script);
 }
コード例 #3
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public CargoSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #4
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public ChassisSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #5
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public UtilitySlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #6
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public WeaponSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #7
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public EngineSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #8
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public ShieldSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #9
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public DriveSlot(ShipComponentDatablock script)
     : base(script)
 {
 }
コード例 #10
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
 public void Load()
 {
     if (!System.String.IsNullOrEmpty(scriptName))
         component = DatablockManager.Instance.GetDatablock<ShipComponentDatablock>(scriptName);
 }
コード例 #11
0
ファイル: ShipManager.cs プロジェクト: Daloupe/Syzygy_Git
    public void ChangeComponent(ShipComponentDatablock script)
    {
        if (script != null)
        {

            component = script;
            scriptName = script.name;
            mods = new Dictionary<ShipStats, ComponentStat>();
        }
    }
コード例 #12
0
ファイル: SetTooltip.cs プロジェクト: Daloupe/Syzygy_Git
 public override void OnExit()
 {
     component = null;
     base.OnExit();
 }
コード例 #13
0
ファイル: SetTooltip.cs プロジェクト: Daloupe/Syzygy_Git
 public override void OnEnter()
 {
     base.OnEnter();
     component = Fsm.EventData.ObjectData as ShipComponentDatablock;
     SetHeader();
     SetInfo();
     SetStats();
 }