Commit ef3f9b4e authored by 赤子奈落's avatar 赤子奈落

new chain button

parent 3fb55382
......@@ -14,7 +14,7 @@ public class descKeeper : MonoBehaviour
// Update is called once per frame
private void Update()
{
if (back.width < card.width) back.width = card.width + 20;
if (back.width < card.width * 2) back.width = card.width * 2;
back.transform.localPosition = new Vector3(back.width / 2f, 0);
var leftTop = new Vector3(-back.width / 2 + 2 + back.transform.localPosition.x, +back.height / 2 - 2 + back.transform.localPosition.y);
//card.transform.localPosition = new Vector3(leftTop.x + card.width / 2, leftTop.y - card.height / 2);
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AttributeIcons : MonoBehaviour
{
public Sprite null_;
public Sprite light_;
public Sprite dark_;
public Sprite water_;
public Sprite fire_;
public Sprite earth_;
public Sprite wind_;
public Sprite divine_;
public Sprite spell_;
public Sprite trap_;
UI2DSprite sprite;
private void Start()
{
sprite = GetComponent<UI2DSprite>();
}
public void ChangeAttribute(string att)
{
switch (att)
{
case "无":
sprite.sprite2D = null_;
break;
case "光":
sprite.sprite2D = light_;
break;
case "暗":
sprite.sprite2D = dark_;
break;
case "水":
sprite.sprite2D = water_;
break;
case "炎":
sprite.sprite2D = fire_;
break;
case "地":
sprite.sprite2D = earth_;
break;
case "风":
sprite.sprite2D = wind_;
break;
case "神":
sprite.sprite2D = divine_;
break;
case "魔法":
sprite.sprite2D = spell_;
break;
case "陷阱":
sprite.sprite2D = trap_;
break;
}
}
}
fileFormatVersion: 2
guid: c6ce984335a805841a56e4ecaae9db6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -6378,6 +6378,115 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 739825426}
m_PrefabAsset: {fileID: 0}
--- !u!1 &744390418
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 744390419}
- component: {fileID: 744390420}
- component: {fileID: 744390421}
m_Layer: 8
m_Name: attribute_
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &744390419
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 744390418}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 113, y: 281, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 726661401}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &744390420
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 744390418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e96b31ce75e592f45a1cff563a4869db, type: 3}
m_Name:
m_EditorClassIdentifier:
leftAnchor:
target: {fileID: 781558413}
relative: 1
absolute: -30
rightAnchor:
target: {fileID: 781558413}
relative: 1
absolute: -4
bottomAnchor:
target: {fileID: 781558413}
relative: 0
absolute: 0
topAnchor:
target: {fileID: 781558413}
relative: 1
absolute: 0
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 26
mHeight: 26
mDepth: 101
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 1
aspectRatio: 1
mType: 0
mFillDirection: 4
mFillAmount: 1
mInvert: 0
mFlip: 0
centerType: 1
leftType: 1
rightType: 1
bottomType: 1
topType: 1
mSprite: {fileID: 21300000, guid: e0abc31613480294e9ed2fb6e2718566, type: 2}
mMat: {fileID: 0}
mShader: {fileID: 4800000, guid: e75727d9555d9d14ca51d91908c681bc, type: 3}
mBorder: {x: 0, y: 0, z: 0, w: 0}
mFixedAspect: 0
mPixelSize: 1
nextSprite: {fileID: 0}
--- !u!114 &744390421
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 744390418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c6ce984335a805841a56e4ecaae9db6b, type: 3}
m_Name:
m_EditorClassIdentifier:
null_: {fileID: 21300000, guid: e0abc31613480294e9ed2fb6e2718566, type: 2}
light_: {fileID: 21300000, guid: 180402ca586225444ba38015a00ddb68, type: 2}
dark_: {fileID: 21300000, guid: 0dae9df21795ad640892a1081aa85b9f, type: 2}
water_: {fileID: 21300000, guid: 72310dd4c8664404ca30b62d994c7f52, type: 2}
fire_: {fileID: 21300000, guid: 33430d8012e54e944b044b7634009bfd, type: 2}
earth_: {fileID: 21300000, guid: 1aa66183d78561541ba6f5846e6f040b, type: 2}
wind_: {fileID: 21300000, guid: afc409f34b41411468308f9dfd05dc42, type: 2}
divine_: {fileID: 21300000, guid: a20c271bad410024b93c2a8970d17d14, type: 2}
spell_: {fileID: 21300000, guid: 483893b19d0469e4e928aecacb85903f, type: 2}
trap_: {fileID: 21300000, guid: 244cae693caa51340a7e05ba64d0ee90, type: 2}
--- !u!1 &781558412
GameObject:
m_ObjectHideFlags: 0
......@@ -8310,7 +8419,7 @@ MonoBehaviour:
rightAnchor:
target: {fileID: 781558413}
relative: 1
absolute: 0
absolute: -30
bottomAnchor:
target: {fileID: 781558413}
relative: 0
......@@ -8322,13 +8431,13 @@ MonoBehaviour:
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 3
mWidth: 252
mWidth: 222
mHeight: 30
mDepth: 101
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 8.4
aspectRatio: 7.4
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: d086cc69053abce42a6351765ad88863, type: 3}
mFont: {fileID: 0}
......
......@@ -50,7 +50,7 @@ public class CardDescription : Servant
private UI2DSprite type_base;
private UIWidget property;
PropertyIcons pi;
AttributeIcons ai;
public override void initialize()
{
gameObject = Program.I().new_ui_cardDescription;
......@@ -88,6 +88,7 @@ public class CardDescription : Servant
property = UIHelper.getByName<UIWidget>(gameObject.gameObject, "property_");
pi = GameObject.Find("ui_back_ground_2d").transform.Find("new_cardDescriptionRemaster/property_").GetComponent<PropertyIcons>();
ai = GameObject.Find("ui_back_ground_2d").transform.Find("new_cardDescriptionRemaster/attribute_").GetComponent<AttributeIcons>();
try
{
description.textLabel.fontSize = int.Parse(Config.Get("fontSize", "14"));
......@@ -221,7 +222,7 @@ public class CardDescription : Servant
type_name.text = GameStringHelper.GetType(card);
FrameColor();
SetProperty(card, smallstr);
SetAttribute(card, smallstr);
picLoader.code = card.Id;
picLoader.defaults = def;
......@@ -229,6 +230,17 @@ public class CardDescription : Servant
shiftCardShower(true);
Program.go(50, () => { shiftCardShower(true); });
}
private void SetAttribute(Card data, string secondType)
{
if(type_name.text.Contains("魔法"))
ai.ChangeAttribute("魔法");
else if (type_name.text.Contains("陷阱"))
ai.ChangeAttribute("陷阱");
else if (GameStringHelper.attribute(data.Attribute) != "")
ai.ChangeAttribute(GameStringHelper.attribute(data.Attribute));
else
ai.ChangeAttribute("无");
}
private void SetProperty(Card data, string secondType)
{
......
......@@ -4155,7 +4155,7 @@ public class Ocgcore : ServantWithCardDescription
card.p.reason = reason;
card.p_moveBefore = from;
if ((from.location & (uint)CardLocation.Onfield) == 0 && (to.location & (uint)CardLocation.Onfield) > 0)
if ((from.location & (uint)CardLocation.Onfield) == 0 && (from.location & (uint)CardLocation.Hand) > 0 && (to.location & (uint)CardLocation.Onfield) > 0)
card.firstOnField = true;
if ((to.location & (uint)CardLocation.Onfield) == 0)
card.firstOnField = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment