public virtual void Start() { MFPEditorUtils.Log("PlayerWings Awake"); root = (RootScript)GameObject.Find("Root").GetComponent(typeof(RootScript)); playerScript = (PlayerScript)GameObject.Find("Player").GetComponent(typeof(PlayerScript)); playerInput = ReInput.players.GetPlayer(0); gameObject.AddComponent <BoxCollider>(); // theSound = (AudioSource)GetComponent(typeof(AudioSource)); transform.parent = GameObject.Find("Player/PlayerGraphics/Armature/Center/LowerBack/UpperBack/Neck/Head").transform; transform.localPosition = new Vector3(-0.226f, 0.0f, 0.007f); // GameObject.Find("Player/PlayerGraphics/Hair").SetActive(false); // propeller = transform.Find("FlyHelmet_Propeller"); // umbrella = propeller.Find("FlyHelmet_Umbrella"); // propellerStartRotation = propeller.localRotation; playerScript.propellerHat = true; upperLegR = GameObject.Find("Player/PlayerGraphics/Armature/Center/Hip_R/UpperLeg_R").transform; lowerLegR = GameObject.Find("Player/PlayerGraphics/Armature/Center/Hip_R/UpperLeg_R/LowerLeg_R").transform; upperLegL = GameObject.Find("Player/PlayerGraphics/Armature/Center/Hip_L/UpperLeg_L").transform; lowerLegL = GameObject.Find("Player/PlayerGraphics/Armature/Center/Hip_L/UpperLeg_L/LowerLeg_L").transform; if (checkpointFix) { playerScript.transform.position = FinalBattleController.playerPosHack; } }
public void Awake() { thePlayer = MFPClassicAssets.player; startScale = transform.localScale; root = MFPClassicAssets.root; collider = GetComponent <Collider>(); transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); StartCoroutine(ScaleUp()); }
public static void doPedroHint(string txt, float timer = -99999) { RootScript root = GameObject.Find("Root").GetComponent <RootScript>(); if (root != null) { root.pedroHintTimer = timer; root.StartCoroutine(root.doPedroHint(txt)); } }
public virtual void Start() { this.root = (RootScript)GameObject.Find("Root").GetComponent(typeof(RootScript)); this.theRectTransform = (RectTransform)this.gameObject.GetComponent(typeof(RectTransform)); this.uiImage = (Image)this.GetComponent(typeof(Image)); this.bulletImage = (Image)this.transform.Find("Ammo").GetComponent(typeof(Image)); this.plusImage = (Image)this.transform.Find("Plus").GetComponent(typeof(Image)); this.startDeltaSize = this.theRectTransform.sizeDelta; uiImage.preserveAspect = true; this.gameObject.SetActive(false); }
public void Add(RootScript rootScript) { string path = string.Format(@"{0}/Resources/{1}.xml", Application.dataPath, configPath); XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(path); var root = xmlDocument.DocumentElement; var script = xmlDocument.CreateElement("RootScript"); script.SetAttribute("SceneName", rootScript.SceneName); script.SetAttribute("ScriptName", rootScript.ScriptName); script.InnerText = rootScript.LuaScriptPath; root.AppendChild(script); xmlDocument.Save(path); }
IEnumerator DeathExplosions() { RootScript root = RootScript.RootScriptInstance; while (explosions != 0) { root.explode(victorBoss.transform.position, 6, 1, Vector3.zero, "Yellow", true, true); explosions--; yield return(new WaitForSeconds(0.2f)); } yield return(new WaitForSeconds(5)); GameObject.FindObjectOfType <CameraScript>().enabled = false; root.explode(PlayerScript.PlayerInstance.transform.position, 12, 1, Vector3.zero, "Yellow", false, true); PlayerScript.PlayerInstance.gameObject.SetActive(false); yield return(new WaitForSeconds(3)); creditsRoot.gameObject.SetActive(true); yield return(new WaitForSeconds(1)); winRect.gameObject.SetActive(true); yield return(new WaitForSeconds(2)); float targetSec = 20; float curSec = 0; while (curSec <= targetSec) { curSec += Time.deltaTime; creditsRoot.anchoredPosition += new Vector2(0, (Time.deltaTime * 64) * root.timescale); yield return(null); } yield return(new WaitForSeconds(3)); MFPClassicAssets.rootShared.modSideOnCamera = false; GameObject.FindObjectOfType <LevelChangerScript>().doTheThing(); creditsRoot.gameObject.SetActive(false); }
public virtual void Start() { if (!((UnityEngine.Object) this.root == (UnityEngine.Object)null)) { return; } this.root = RootScript.RootScriptInstance; this.mainCamera = Camera.main; this.mainPlayer = !((UnityEngine.Object)PlayerScript.PlayerInstance == (UnityEngine.Object)null) ? PlayerScript.PlayerInstance.transform : GameObject.Find("Player").transform; this.swirl = (RectTransform)this.transform.Find("Swirl").GetComponent(typeof(RectTransform)); this.iconTransform = (RectTransform)this.transform.Find("Icon").GetComponent(typeof(RectTransform)); this.icon = (Image)this.iconTransform.GetComponent(typeof(Image)); icon.preserveAspect = true; this.iconStartColor = this.icon.color; this.startIconTransformSizeDelta = this.iconTransform.sizeDelta; this.uiImg = (Image)this.swirl.GetComponent(typeof(Image)); }
public virtual void Start() { this.root = (RootScript)GameObject.Find("Root").GetComponent(typeof(RootScript)); this.bg = (RectTransform)this.transform.Find("Background").GetComponent(typeof(RectTransform)); this.bgImg = (Image)this.bg.GetComponent(typeof(Image)); this.lCurve = (RectTransform)this.transform.Find("Background/LeftCurveLine").GetComponent(typeof(RectTransform)); this.lCurveImg = (Image)this.lCurve.GetComponent(typeof(Image)); this.rCurve = (RectTransform)this.transform.Find("Background/RightCurveLine").GetComponent(typeof(RectTransform)); this.rCurveImg = (Image)this.rCurve.GetComponent(typeof(Image)); this.lLine = (RectTransform)this.transform.Find("Background/LeftLine").GetComponent(typeof(RectTransform)); this.rLine = (RectTransform)this.transform.Find("Background/RightLine").GetComponent(typeof(RectTransform)); this.bgDetailImg = (Image)this.transform.Find("BackgroundDetail").GetComponent(typeof(Image)); this.weaponIconImg = (Image)this.transform.Find("Background/Mask/WeaponIcon").GetComponent(typeof(Image)); weaponIconImg.preserveAspect = true; this.Update(); this.OnEnable(); }
public virtual void Start() { this.mainPlayer = PlayerScript.PlayerInstance.transform; this.mainPlayerHand = this.mainPlayer.Find("PlayerGraphics/Armature/Center/LowerBack/UpperBack/Shoulder_R/UpperArm_R/LowerArm_R/Hand_R"); this.root = RootScript.RootScriptInstance; this.rootShared = RootSharedScript.Instance; this.targetYRot = (double)this.transform.localRotation.eulerAngles.y >= 90.0 ? 90f : 270f; this.layerMask = (LayerMask)98560; this.rBody = (Rigidbody)this.gameObject.GetComponent(typeof(Rigidbody)); this.playerScript = (PlayerScript)this.mainPlayer.GetComponent(typeof(PlayerScript)); if (this.motorcycle) { RigidBodySlowMotion component = (RigidBodySlowMotion)this.GetComponent(typeof(RigidBodySlowMotion)); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { component.enabled = false; } this.motorcycleYSpeed = 0.3f; } this.ranOffsetNr = UnityEngine.Random.value * 5f; }
void FindEnemies(Vector3 jugador) { time = velocidadGiro; //visibleEnemies.Clear(); if (jugador != new Vector3(0, 0, 0)) { Collider[] EnemiesInViewRadius = Physics.OverlapSphere(transform.position, viewRadius, enemyMask); for (int i = 0; i < EnemiesInViewRadius.Length; i++) { // GameObject target = EnemiesInViewRadius[i].gameObject; RootScript enemy = EnemiesInViewRadius[i].GetComponent <RootScript>(); if (enemy.Estado != 2) { enemy.Target = jugador; enemy.Estado = 3; //visibleEnemies.Add(enemy); print("le avisé a los otros ene"); } } } }
public void Start() { //eğer boss aniden çalışmamaya başlarsa burdaki koda ilk göz at, belki isim değiştirmişsindir. root = MFPClassicAssets.root; player = MFPClassicAssets.player; headPivot = transform.Find("body/headPivot"); head = headPivot.Find("head"); headLerpPoint = headPivot.Find("jawLerp"); jaw = headPivot.Find("jaw"); shootNode = head.Find("shootNode"); arm = transform.Find("body/armPivot"); spatulaArmStartPoint = transform.Find("body/spatulaArmStartPoint"); spatulaArmEndPoint = arm.localPosition; arm.transform.position = spatulaArmStartPoint.position; arm.gameObject.SetActive(false); spatula = transform.Find("body/armPivot/spatulaColl").gameObject.AddComponent <VictorSpatula>(); defaultHeadRotation = headPivot.rotation; lerpDefaultPos = headLerpPoint.transform.localPosition; victorAnimator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); transform.Find("body").gameObject.AddComponent <VictorLimb>(); arm.transform.Find("handColl").gameObject.AddComponent <VictorLimb>(); arm.transform.Find("armColl").gameObject.AddComponent <VictorLimb>(); head.transform.Find("headCollider").gameObject.AddComponent <VictorLimb>(); healthBar = FinalBattleController.inst.bossfightUI.transform.Find("HealthOutline/Health").GetComponent <Image>(); }
protected override void Action(RootScript rs) { rs.AddHealth (Amount); }
protected virtual void Action(RootScript rootscript) { //TODO do nothing, correct implementation in inheriting implementations }
private void OnGUI() { EditorGUILayout.Space(); GUILayout.Label(new GUIContent("AppScriptConfig"), titleStyle); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(titleStyle); GUILayout.Label(new GUIContent("MainSceneName"), titleStyle); level = EditorGUILayout.Popup(level, SceneNames.ToArray()); EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if (config.RootScript.Count > 0) { for (int i = 0; i < config.RootScript.Count; i++) { EditorGUILayout.BeginHorizontal(titleStyle); GUILayout.Label(new GUIContent("RootScript"), titleStyle); GUILayout.Label("1.SceneName"); levels[i] = EditorGUILayout.Popup(levels[i], SceneNames.ToArray()); GUILayout.Label("2.ScriptName"); config.RootScript[i].ScriptName = EditorGUILayout.TextField(config.RootScript[i].ScriptName); GUILayout.Label("3.LuaScriptPath"); config.RootScript[i].LuaScriptPath = EditorGUILayout.TextField(config.RootScript[i].LuaScriptPath); if (GUILayout.Button("Remove", titleStyle)) { if (config.RootScript.Count > 1) { Remove(i); config.RootScript.RemoveAt(i); levels.RemoveAt(i); } else { Debug.Log("不能删除最后一个RootScript"); } } EditorGUILayout.EndHorizontal(); } } EditorGUILayout.Space(); if (GUILayout.Button("Add New Root Script")) { RootScript rootScript = new RootScript { SceneName = "TestScene", ScriptName = "Test.TestRoot", LuaScriptPath = "Test/TestRoot", }; int index = SceneNames.IndexOf("TestScene"); Add(rootScript); config.RootScript.Add(rootScript); levels.Add(index); } if (GUILayout.Button("UpdateConfig")) { UpdateConfig(); } EditorGUILayout.EndVertical(); }
public void SetRoot(RootScript root) { Root = root; }
public void Start() { root = MFPClassicAssets.root; }
static void Testing(RootScript __instance) { __instance.weaponIcons[5] = MFPClassicAssets.m4Sprite; }
protected override void Action(RootScript rs) { rs.AddPower (Amount); }
static void Testing(RootScript __instance) { __instance.levelToLoad = 6; }