public void Initialize() { parent = new SpinObject(); child = new SpinObject(); childNotAdded = new SpinObject(); var texture = Engine.Graphics.CreateTexture2D(CloudTexturePath); parent.Texture = texture; parent.CenterPosition = texture.Size.To2DF() / 2; parent.Scale = new Vector2DF(0.5f, 0.5f); parent.Position = position; child.Texture = texture; child.CenterPosition = texture.Size.To2DF() / 2; child.Scale = new Vector2DF(0.5f, 0.5f); child.Position = position + new Vector2DF(0, 100); childNotAdded.Texture = texture; childNotAdded.CenterPosition = texture.Size.To2DF() / 2; childNotAdded.Scale = new Vector2DF(0.5f, 0.5f); childNotAdded.Position = position + new Vector2DF(0, 200); parent.AddChild(child, mode, ChildTransformingMode.Nothing); parent.AddChild(childNotAdded, mode, ChildTransformingMode.Nothing); Engine.AddObject2D(parent); if ((mode & ChildManagementMode.RegistrationToLayer) == 0) { Engine.AddObject2D(child); } Assert.AreNotEqual(null, child.Parent); Assert.AreNotEqual(null, child.Parent.Layer); }
private void CreateAttack() { GameObject spin = GameObject.Instantiate(Resources.Load("Prefabs/spin")) as GameObject; SpinObject spinScript = spin.GetComponent <SpinObject>(); spinScript.Make(player); }
public void RotateMarker() { spinObjectScript = GetComponentInChildren <SpinObject>(); spinSpeed = spinObjectScript.spinSpeed; markerRotationAngle -= (spinSpeed * Time.deltaTime); transform.rotation = Quaternion.Euler(0f, 0f, markerRotationAngle); }
protected SpinObject mSpinObject; //< 主窗口旋转预览角色脚本对象aa void Awake() { mSpinObject = this.gameObject.GetComponent <SpinObject>(); if (m_SelectRoleWndObject) { mSelectRole = m_SelectRoleWndObject.GetComponent <SelectRole>(); } // 根据分辨率调整显示... GameObject obj = GameObject.Find("sp_link"); if (obj != null) { float r = 1.777f / ((float)Screen.width / (float)Screen.height) - 1.0f; float y = (1280.0f / (float)Screen.width * (float)Screen.height - 720.0f) / 2.0f + 1000.0f; // 16:9下的y为1000,4:3下的y为1120 obj.GetComponent <TweenPosition>().from.y = y; obj.GetComponent <TweenPosition>().to.y = y - 612.0f - 240.0f * r; // 对4:3屏幕,r=0.33,锁链长度一共会增长80 } // 对应3:2以上比例的屏幕,把主角圆盘右移一些... obj = GameObject.Find("city_construct_halidom02"); if (obj != null) { if (((float)Screen.width / (float)Screen.height) <= 1.5) { obj.transform.localPosition = new Vector3(-0.5f, obj.transform.localPosition.y, obj.transform.localPosition.z); } } // 如果一个角色都没创建过,则自动跳到角色创建界面. if (SDNetGlobal.playerList[0] == null && SDNetGlobal.playerList[1] == null && SDNetGlobal.playerList[2] == null && SDNetGlobal.playerList[3] == null) { mSelectRole.CreateChar(); } }
// Start is called before the first frame update void Start() { gameSaverScript = FindObjectOfType <GameSaver>(); spinObjectScript = GetComponent <SpinObject>(); if (PlayerPrefs.GetInt(gameSaverScript.keyStartingMarkerSpin) == 0) { spinObjectScript.rotateMarker = true; } }
//private ActivatorCollisions activatorCollisionsScript; // Start is called before the first frame update void Start() { activeMarker = false; gameSaverScript = FindObjectOfType <GameSaver>(); setStarStatusMapScreenScript = FindObjectOfType <SetStarStatusMapScreen>(); spinObjectScript = GetComponent <SpinObject>(); levelMenu.transform.GetComponent <Canvas>().worldCamera = cam; PlayerPrefs.SetInt(activeCityName + gameSaverScript.keyScoreReqPerLevel, activatePointsReq); PlayerPrefs.SetInt(activeCityName + gameSaverScript.keyCoinsReqPerLevel, activateCoinsReq); PlayerPrefs.SetInt(activeCityName + gameSaverScript.keyMatchesReqPerLevel, activateMatchesReq); }
public override void Init() { base.Init(); this.m_bIsLeaveFirstCreatePanel = false; this.m_bIsLeaveSecondCreatePanel = false; this.m_createPanel1 = base.uiBehaviour.transform.FindChild("pn_create1").gameObject; this.m_createPanel2 = base.uiBehaviour.transform.FindChild("pn_create2").gameObject; this.m_movieTexture = Resources.Load("Data/Video/beginAnimation") as MovieTexture; this.m_movieTexture.loop = true; this.m_oExplorerIntro = base.uiBehaviour.transform.FindChild("pn_create1/sp_intro/explorer_intro").gameObject; this.m_oMagicianIntro = base.uiBehaviour.transform.FindChild("pn_create1/sp_intro/magician_intro").gameObject; this.m_oEngineerIntro = base.uiBehaviour.transform.FindChild("pn_create1/sp_intro/engineer_intro").gameObject; this.m_oCultivatorIntro = base.uiBehaviour.transform.FindChild("pn_create1/sp_intro/cultivator_intro").gameObject; this.m_spinObj = this.uiBehaviour.GetComponent <SpinObject>(); }
public void next() { DragableObject dragableObject = enigmes[status].GetComponentInChildren <DragableObject>(); if (dragableObject != null) { dragableObject.isDragable = false; } else { SpinObject spinObject = enigmes[status].GetComponentInChildren <SpinObject>(); if (spinObject != null) { spinObject.isDragable = false; } else { PorteEnigme enigmeObject = enigmes[status].GetComponentInChildren <PorteEnigme>(); if (enigmeObject != null) { enigmeObject.isDragable = false; } } } if (status < enigmes.Length - 1) { enigmes[status + 1].SetActive(true); if (idEnigme == 1 && status == 1) { enigmes[0].SetActive(false); enigmes[1].SetActive(false); for (int i = 0; i < objectsToChange.Length; i++) { objectsToChange[i].sprite = correspondinNewSprites[i]; } } } else { StartCoroutine(End()); } VFXSource.PlayOneShot(successClips[status]); status++; }
private void Start() { spinObject = this; }
void Awake() { if (m_CreateRoleRaceWndObject) { mCreateRoleRace = m_CreateRoleRaceWndObject.GetComponent <CreateRoleRace>(); } mSpinObject = this.gameObject.GetComponent <SpinObject>(); foreach (GameObject kGameObject in m_HairStyleObjectArray) { if (kGameObject == null) { continue; } DragPanelIcon kIcon = kGameObject.GetComponent <DragPanelIcon>(); if (kIcon != null) { kIcon.onDragFinished += onHairStyleSelected; } } foreach (GameObject kGameObject in m_HairColorObjectArray) { if (kGameObject == null) { continue; } DragPanelIcon kIcon = kGameObject.GetComponent <DragPanelIcon>(); if (kIcon != null) { kIcon.onDragFinished += onHairColorSelected; } } // LoadHairAtlas(0, 0, 0); // LoadHairAtlas(0, 1, 0); // LoadHairAtlas(0, 2, 0); // LoadHairAtlas(0, 3, 0); // LoadHairAtlas(0, 4, 0); // LoadHairAtlas(0, 5, 0); // LoadHairAtlas(0, 6, 0); // LoadHairAtlas(0, 7, 0); // LoadHairAtlas(1, 0, 0); // LoadHairAtlas(1, 1, 0); // LoadHairAtlas(1, 2, 0); // LoadHairAtlas(1, 3, 0); // LoadHairAtlas(1, 4, 0); // LoadHairAtlas(1, 5, 0); // LoadHairAtlas(1, 6, 0); // LoadHairAtlas(1, 7, 0); // 根据分辨率调整显示... GameObject obj = GameObject.Find("sp_link1"); if (obj != null) { float r = 1.777f / ((float)Screen.width / (float)Screen.height) - 1.0f; float y = (1280.0f / (float)Screen.width * (float)Screen.height - 720.0f) / 2.0f + 1030.0f; // 16:9下的y为1030,4:3下的y为1150 obj.GetComponent <TweenPosition>().from.y = y; obj.GetComponent <TweenPosition>().to.y = y - 620.0f - 300.0f * r; // 对4:3屏幕,r=0.33,锁链长度一共会增长100 } obj = GameObject.Find("sp_link2"); if (obj != null) { float r = 1.777f / ((float)Screen.width / (float)Screen.height) - 1.0f; float y = (1280.0f / (float)Screen.width * (float)Screen.height - 720.0f) / 2.0f + 980.0f; // 16:9下的y为980,4:3下的y为1100 obj.GetComponent <TweenPosition>().from.y = y; obj.GetComponent <TweenPosition>().to.y = y - 570.0f - 300.0f * r; // 对4:3屏幕,r=0.33,锁链长度一共会增长100 } }