diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleBall.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleBall.cs index 13c948e..de2eb8a 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleBall.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleBall.cs @@ -7,12 +7,12 @@ public class GA_ExampleBall : MonoBehaviour void Start () { - rigidbody.velocity = new Vector3(Random.value * 0.2f - 0.1f, -1, 0) * Speed; + GetComponent().velocity = new Vector3(Random.value * 0.2f - 0.1f, -1, 0) * Speed; } void Update() { - rigidbody.AddForce(Vector3.down * 0.0001f); - rigidbody.velocity = rigidbody.velocity.normalized * Speed; + GetComponent().AddForce(Vector3.down * 0.0001f); + GetComponent().velocity = GetComponent().velocity.normalized * Speed; } } diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleController.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleController.cs index d39c96f..2bf4cc3 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleController.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleController.cs @@ -12,11 +12,11 @@ void Update () targetVelocity *= Speed; // Apply a force that attempts to reach our target velocity - Vector3 velocity = rigidbody.velocity; + Vector3 velocity = GetComponent().velocity; Vector3 velocityChange = (targetVelocity - velocity); velocityChange.x = Mathf.Clamp(velocityChange.x, -MaxVelocityChange, MaxVelocityChange); velocityChange.y = 0; velocityChange.z = 0; - rigidbody.AddForce(velocityChange, ForceMode.VelocityChange); + GetComponent().AddForce(velocityChange, ForceMode.VelocityChange); } } diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleFloor.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleFloor.cs index 23ec3a8..1bac25e 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleFloor.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleFloor.cs @@ -5,7 +5,7 @@ public class GA_ExampleFloor : MonoBehaviour { void Start () { - renderer.material.color = Color.red; + GetComponent().material.color = Color.red; } void OnCollisionEnter(Collision collision) diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleHighScore.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleHighScore.cs index 0833916..71b1ab9 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleHighScore.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleHighScore.cs @@ -118,7 +118,7 @@ private void HighScoreWindow(int windowID) ball.name = "Ball"; transform.position = _startingPosition; - rigidbody.velocity = Vector3.zero; + GetComponent().velocity = Vector3.zero; } if (!genderComboBoxControl.IsShowingList()) diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleTarget.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleTarget.cs index 7fc5fb8..151bb90 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleTarget.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleTarget.cs @@ -9,14 +9,14 @@ public class GA_ExampleTarget : MonoBehaviour void Start () { - renderer.material.color = Color.yellow; + GetComponent().material.color = Color.yellow; } void Update () { if (!_hit) { - rigidbody.AddTorque(Vector3.forward * SpinSpeed); + GetComponent().AddTorque(Vector3.forward * SpinSpeed); } } @@ -33,11 +33,11 @@ void OnCollisionEnter(Collision collision) IEnumerator FlashColor(float duration) { _hit = true; - renderer.material.color = Color.green; + GetComponent().material.color = Color.green; yield return new WaitForSeconds(duration); _hit = false; - renderer.material.color = Color.yellow; + GetComponent().material.color = Color.yellow; } } diff --git a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleWall.cs b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleWall.cs index 53d0a40..1c6fbb4 100644 --- a/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleWall.cs +++ b/Assets/GameAnalytics/Plugins/Examples/Scripts/GA_ExampleWall.cs @@ -5,6 +5,6 @@ public class GA_ExampleWall : MonoBehaviour { void Start () { - renderer.material.color = Color.gray; + GetComponent().material.color = Color.gray; } } diff --git a/Assets/GameAnalytics/Plugins/Framework/Scripts/GA.cs b/Assets/GameAnalytics/Plugins/Framework/Scripts/GA.cs index 272ac78..ab22d1e 100644 --- a/Assets/GameAnalytics/Plugins/Framework/Scripts/GA.cs +++ b/Assets/GameAnalytics/Plugins/Framework/Scripts/GA.cs @@ -193,9 +193,9 @@ public static void HierarchyWindowCallback (int instanceID, Rect selectionRect) if (GA.SettingsGA.Logo == null) { - GA.SettingsGA.Logo = (Texture2D)Resources.LoadAssetAtPath("Assets/GameAnalytics/Plugins/Examples/gaLogo.png", typeof(Texture2D)); + GA.SettingsGA.Logo = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/GameAnalytics/Plugins/Examples/gaLogo.png", typeof(Texture2D)); if (GA.SettingsGA.Logo == null) - GA.SettingsGA.Logo = (Texture2D)Resources.LoadAssetAtPath("Assets/Plugins/GameAnalytics/Examples/gaLogo.png", typeof(Texture2D)); + GA.SettingsGA.Logo = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/Plugins/GameAnalytics/Examples/gaLogo.png", typeof(Texture2D)); } Graphics.DrawTexture(new Rect(GUILayoutUtility.GetLastRect().width - selectionRect.height - 5 - addX, selectionRect.y, selectionRect.height, selectionRect.height), GA.SettingsGA.Logo); diff --git a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolid.shader b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolid.shader index c56fe86..786f0ac 100644 --- a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolid.shader +++ b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolid.shader @@ -1,3 +1,6 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' + Shader "Custom/GA_HeatMapSolid" { Properties @@ -48,7 +51,7 @@ Shader "Custom/GA_HeatMapSolid" v2f vert(appdata_full v) { - v.vertex = mul(_Object2World, v.vertex); + v.vertex = mul(unity_ObjectToWorld, v.vertex); v.normal = normalize(_WorldSpaceCameraPos - v.vertex); float3 up = float3(0,1,0); float3 side = normalize(cross(v.normal, up)); @@ -69,7 +72,7 @@ Shader "Custom/GA_HeatMapSolid" if(size > 0.0 && size < 1.0) { v.vertex.xyz = v.vertex.xyz + (v.texcoord.x * side + v.texcoord.y * up) * max(size * _MaxRadius, 0.1) * 3; - v.vertex = mul(_World2Object, v.vertex); + v.vertex = mul(unity_WorldToObject, v.vertex); } v2f o; diff --git a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolidOverlay.shader b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolidOverlay.shader index 256fe40..1edc95d 100644 --- a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolidOverlay.shader +++ b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapSolidOverlay.shader @@ -1,3 +1,6 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' + Shader "Custom/GA_HeatMapSolidOverlay" { Properties @@ -47,7 +50,7 @@ Shader "Custom/GA_HeatMapSolidOverlay" v2f vert(appdata_full v) { - v.vertex = mul(_Object2World, v.vertex); + v.vertex = mul(unity_ObjectToWorld, v.vertex); v.normal = normalize(_WorldSpaceCameraPos - v.vertex); float3 up = float3(0,1,0); float3 side = normalize(cross(v.normal, up)); @@ -68,7 +71,7 @@ Shader "Custom/GA_HeatMapSolidOverlay" if(size > 0.0 && size < 1.0) { v.vertex.xyz = v.vertex.xyz + (v.texcoord.x * side + v.texcoord.y * up) * max(size * _MaxRadius, 0.1) * 3; - v.vertex = mul(_World2Object, v.vertex); + v.vertex = mul(unity_WorldToObject, v.vertex); } v2f o; @@ -144,7 +147,7 @@ Shader "Custom/GA_HeatMapSolidOverlay" v2f vert(appdata_full v) { - v.vertex = mul(_Object2World, v.vertex); + v.vertex = mul(unity_ObjectToWorld, v.vertex); v.normal = normalize(_WorldSpaceCameraPos - v.vertex); float3 up = float3(0,1,0); float3 side = normalize(cross(v.normal, up)); @@ -165,7 +168,7 @@ Shader "Custom/GA_HeatMapSolidOverlay" if(size > 0.0 && size < 1.0) { v.vertex.xyz = v.vertex.xyz + (v.texcoord.x * side + v.texcoord.y * up) * max(size * _MaxRadius, 0.1); - v.vertex = mul(_World2Object, v.vertex); + v.vertex = mul(unity_WorldToObject, v.vertex); } v2f o; diff --git a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparent.shader b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparent.shader index 19f5227..3be1e03 100644 --- a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparent.shader +++ b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparent.shader @@ -1,3 +1,6 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' + Shader "Custom/GA_HeatMapTransparent" { Properties @@ -52,7 +55,7 @@ Shader "Custom/GA_HeatMapTransparent" v2f vert(appdata_full v) { - v.vertex = mul(_Object2World, v.vertex); + v.vertex = mul(unity_ObjectToWorld, v.vertex); v.normal = normalize(_WorldSpaceCameraPos - (float3)v.vertex); float3 up = float3(0,1,0); float3 side = normalize(cross(v.normal, up)); @@ -62,7 +65,7 @@ Shader "Custom/GA_HeatMapTransparent" { up = normalize(cross(side, v.normal)); v.vertex.xyz = v.vertex.xyz + (v.texcoord.x * side + v.texcoord.y * up) * _MaxRadius; - v.vertex = mul(_World2Object, v.vertex); + v.vertex = mul(unity_WorldToObject, v.vertex); } v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); diff --git a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparentOverlay.shader b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparentOverlay.shader index cc79fb7..e9a832e 100644 --- a/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparentOverlay.shader +++ b/Assets/GameAnalytics/Plugins/Framework/Shaders/GA_HeatMapTransparentOverlay.shader @@ -1,3 +1,6 @@ +// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' +// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' + Shader "Custom/GA_HeatMapTransparentOverlay" { Properties @@ -52,7 +55,7 @@ Shader "Custom/GA_HeatMapTransparentOverlay" v2f vert(appdata_full v) { - v.vertex = mul(_Object2World, v.vertex); + v.vertex = mul(unity_ObjectToWorld, v.vertex); v.normal = normalize(_WorldSpaceCameraPos - (float3)v.vertex); float3 up = float3(0,1,0); float3 side = normalize(cross(v.normal, up)); @@ -62,7 +65,7 @@ Shader "Custom/GA_HeatMapTransparentOverlay" { up = normalize(cross(side, v.normal)); v.vertex.xyz = v.vertex.xyz + (v.texcoord.x * side + v.texcoord.y * up) * _MaxRadius; - v.vertex = mul(_World2Object, v.vertex); + v.vertex = mul(unity_WorldToObject, v.vertex); } v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); diff --git a/Assets/Scripts/Behaviors/AudioBehavior.cs b/Assets/Scripts/Behaviors/AudioBehavior.cs index 6c96781..a4c278f 100644 --- a/Assets/Scripts/Behaviors/AudioBehavior.cs +++ b/Assets/Scripts/Behaviors/AudioBehavior.cs @@ -71,18 +71,18 @@ public virtual void InCombat() { if (isMusic == true && isCombatMusic == true) { - audio.clip = combatMusic[Random.Range(0, combatMusic.Count)]; - audio.loop = true; - audio.Play(); + GetComponent().clip = combatMusic[Random.Range(0, combatMusic.Count)]; + GetComponent().loop = true; + GetComponent().Play(); isCombatMusic = false; isGameMusic = true; } if (hasPlayedAudio == false && !isMusic) { - audio.clip = combatAudio[1]; - audio.loop = true; - audio.Play(); + GetComponent().clip = combatAudio[1]; + GetComponent().loop = true; + GetComponent().Play(); hasPlayedAudio = true; } } @@ -91,18 +91,18 @@ public virtual void NotInCombat() { if (isMusic == true && isGameMusic == true) { - audio.clip = gameMusic[Random.Range(0, gameMusic.Count)]; - audio.loop = true; - audio.Play(); + GetComponent().clip = gameMusic[Random.Range(0, gameMusic.Count)]; + GetComponent().loop = true; + GetComponent().Play(); isGameMusic = false; isCombatMusic = true; } if (isMoving == true && !isMusic && !hasPlayedAudio) { - audio.clip = movementAudio[0]; - audio.loop = true; - audio.Play(); + GetComponent().clip = movementAudio[0]; + GetComponent().loop = true; + GetComponent().Play(); hasPlayedAudio = true; } @@ -113,7 +113,7 @@ public virtual void NotInCombat() if (!inCombat && !isMusic) { - audio.loop = false; + GetComponent().loop = false; } } diff --git a/Assets/Scripts/Behaviors/CameraBehavior.cs b/Assets/Scripts/Behaviors/CameraBehavior.cs index fb20108..dc2f8b3 100644 --- a/Assets/Scripts/Behaviors/CameraBehavior.cs +++ b/Assets/Scripts/Behaviors/CameraBehavior.cs @@ -82,7 +82,7 @@ public void Start() /// public void Update() { - if (Camera.current != null && Camera.current != this.camera) + if (Camera.current != null && Camera.current != this.GetComponent()) return; // Perform tracking if the camera is set to track an object. diff --git a/Assets/Scripts/Behaviors/CombatSystemBehavior.cs b/Assets/Scripts/Behaviors/CombatSystemBehavior.cs index 93f3644..470f190 100644 --- a/Assets/Scripts/Behaviors/CombatSystemBehavior.cs +++ b/Assets/Scripts/Behaviors/CombatSystemBehavior.cs @@ -348,7 +348,7 @@ private void createUnits (IEnumerable units, bool flipHorizontally, fl unitBehavior.SetFont(font); if(fontMaterial != null) - unitBehavior.renderer.material = fontMaterial; + unitBehavior.GetComponent().material = fontMaterial; // Load body parts for the unit. foreach (NSSNode node in skele.SkeletonStructure.Nodes) diff --git a/Assets/Scripts/Behaviors/GUI/AnchorBehavior.cs b/Assets/Scripts/Behaviors/GUI/AnchorBehavior.cs index 75a56c5..f9067c4 100644 --- a/Assets/Scripts/Behaviors/GUI/AnchorBehavior.cs +++ b/Assets/Scripts/Behaviors/GUI/AnchorBehavior.cs @@ -52,7 +52,7 @@ void RepositionAnchor() if (oldPosition == anchorPosition) return; if (!hudCamera) - hudCamera = transform.parent.camera; + hudCamera = transform.parent.GetComponent(); float aspectRatio = (float)Screen.width / (float)Screen.height; float height = hudCamera.orthographicSize; diff --git a/Assets/Scripts/Behaviors/GUI/MiniMapGridBehaviour.cs b/Assets/Scripts/Behaviors/GUI/MiniMapGridBehaviour.cs index f8d1389..8755305 100644 --- a/Assets/Scripts/Behaviors/GUI/MiniMapGridBehaviour.cs +++ b/Assets/Scripts/Behaviors/GUI/MiniMapGridBehaviour.cs @@ -55,7 +55,7 @@ void Start() newMiniMapPoint.transform.parent = transform; newMiniMapPoint.name = abc[z].ToString() + x.ToString(); newMiniMapPoint.transform.localPosition = new Vector3(currentXPosition, currentYPosition, -0.01f); - newMiniMapPoint.renderer.enabled = true; + newMiniMapPoint.GetComponent().enabled = true; currentXPosition = (xPositionOffset + z + 1) * 0.1f + 0.05f; theMiniMap[z + (x * miniMapWidth)] = newMiniMapPoint; } @@ -78,7 +78,7 @@ void Start() newMiniMapPlayer = (MiniMapActorBehavior)Instantiate(miniMapPlayer, new Vector3(0, 0.0f, 0.5f), Quaternion.identity); newMiniMapPlayer.transform.parent = transform; newMiniMapPlayer.transform.localPosition = new Vector3(0.0f, 0.0f, 0.1f); - newMiniMapPlayer.renderer.enabled = true; + newMiniMapPlayer.GetComponent().enabled = true; playerSquadList.Add(newMiniMapPlayer); } @@ -88,7 +88,7 @@ void Start() newMiniMapEnemy = (MiniMapActorBehavior)Instantiate(miniMapEnemy, new Vector3(0, 0.0f, 0.5f), Quaternion.identity); newMiniMapEnemy.transform.parent = transform; newMiniMapEnemy.transform.localPosition = new Vector3(0.0f, 0.0f, 0.1f); - newMiniMapEnemy.renderer.enabled = true; + newMiniMapEnemy.GetComponent().enabled = true; enemySquadList.Add(newMiniMapEnemy); } @@ -99,7 +99,7 @@ void Start() newMiniMapNuetral = (MiniMapActorBehavior)Instantiate(miniMapNeutral, new Vector3(0, 0.0f, 0.5f), Quaternion.identity); newMiniMapNuetral.transform.parent = transform; newMiniMapNuetral.transform.localPosition = new Vector3(0.0f, 0.0f, 0.1f); - newMiniMapNuetral.renderer.enabled = true; + newMiniMapNuetral.GetComponent().enabled = true; neutralSquadList.Add(newMiniMapNuetral); } diff --git a/Assets/Scripts/Behaviors/Movement/FenceBehavour.cs b/Assets/Scripts/Behaviors/Movement/FenceBehavour.cs index 140146e..805245e 100644 --- a/Assets/Scripts/Behaviors/Movement/FenceBehavour.cs +++ b/Assets/Scripts/Behaviors/Movement/FenceBehavour.cs @@ -14,7 +14,7 @@ public class FenceBehavour : MonoBehaviour void Start () { - transform.renderer.enabled = false; + transform.GetComponent().enabled = false; } diff --git a/Assets/Scripts/Behaviors/Movement/GridBehavior.cs b/Assets/Scripts/Behaviors/Movement/GridBehavior.cs index 9d0fbd9..aff6a8b 100644 --- a/Assets/Scripts/Behaviors/Movement/GridBehavior.cs +++ b/Assets/Scripts/Behaviors/Movement/GridBehavior.cs @@ -107,8 +107,8 @@ public void HideMovePoints() foreach(MovePointBehavior movePoint in theMap) { //change visiblilty of nodes. - if(movePoint && movePoint.renderer.enabled == true) - movePoint.renderer.enabled = false; + if(movePoint && movePoint.GetComponent().enabled == true) + movePoint.GetComponent().enabled = false; } } diff --git a/Assets/Scripts/Behaviors/Movement/GridControlBehavior.cs b/Assets/Scripts/Behaviors/Movement/GridControlBehavior.cs index b920c74..fa0527e 100644 --- a/Assets/Scripts/Behaviors/Movement/GridControlBehavior.cs +++ b/Assets/Scripts/Behaviors/Movement/GridControlBehavior.cs @@ -277,7 +277,7 @@ private void updateSelectingMovement() { // Retrieve the movepoint behavior from the hit target. MovePointBehavior movePoint = hitInfo.transform.GetComponent(); - if(movePoint == null || !movePoint.renderer.enabled) + if(movePoint == null || !movePoint.GetComponent().enabled) continue; // Retrieve the combat squad behavior from the currently-selected squad. diff --git a/Assets/Scripts/Behaviors/Movement/MovePointBehavior.cs b/Assets/Scripts/Behaviors/Movement/MovePointBehavior.cs index ca16a97..3b06bbc 100644 --- a/Assets/Scripts/Behaviors/Movement/MovePointBehavior.cs +++ b/Assets/Scripts/Behaviors/Movement/MovePointBehavior.cs @@ -21,7 +21,7 @@ public class MovePointBehavior : MonoBehaviour /// public void Start() { - renderer.enabled = false; + GetComponent().enabled = false; } /// @@ -145,7 +145,7 @@ public void HighlightValidNodes(ActorBehavior actor, GridBehavior grid, int rang moveGraph.RemoveAt(0); foreach (MovePointBehavior node in moveGraph) - node.renderer.enabled = true; + node.GetComponent().enabled = true; } /// diff --git a/Assets/Scripts/Behaviors/Sprites/AnimatedSpriteBehavior.cs b/Assets/Scripts/Behaviors/Sprites/AnimatedSpriteBehavior.cs index 79f3057..cd9fd3f 100644 --- a/Assets/Scripts/Behaviors/Sprites/AnimatedSpriteBehavior.cs +++ b/Assets/Scripts/Behaviors/Sprites/AnimatedSpriteBehavior.cs @@ -81,7 +81,7 @@ public void Start() frameSize = new Vector2(1.0f / FrameCount, 1.0f); flippedFrameSize = new Vector2(-(1.0f / FrameCount), 1.0f); - gameObject.renderer.sharedMaterial.SetTextureScale("_MainTex", (IsFlipped ? flippedFrameSize : frameSize)); + gameObject.GetComponent().sharedMaterial.SetTextureScale("_MainTex", (IsFlipped ? flippedFrameSize : frameSize)); } /// @@ -99,11 +99,11 @@ public void Update() if (currentFrame >= FrameCount) currentFrame = 0; - gameObject.renderer.sharedMaterial.SetTextureOffset("_MainTex", frameOffsets[currentFrame]); + gameObject.GetComponent().sharedMaterial.SetTextureOffset("_MainTex", frameOffsets[currentFrame]); } if (lastFlipState != IsFlipped) { - gameObject.renderer.sharedMaterial.SetTextureScale("_MainTex", (IsFlipped ? flippedFrameSize : frameSize)); + gameObject.GetComponent().sharedMaterial.SetTextureScale("_MainTex", (IsFlipped ? flippedFrameSize : frameSize)); lastFlipState = IsFlipped; } } diff --git a/Assets/Scripts/Behaviors/UnitCreator/ArmyManagementBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/ArmyManagementBehaviour.cs index 312d021..315438f 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/ArmyManagementBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/ArmyManagementBehaviour.cs @@ -253,11 +253,11 @@ void StartEditor(SquadBehaviour theSquad) { for (int index = 0; index < squads.Count; index++) { - squads[index].transform.renderer.enabled = false; + squads[index].transform.GetComponent().enabled = false; } MemberTray.ShowMemberTray(); - statsPanel.transform.renderer.enabled = true; + statsPanel.transform.GetComponent().enabled = true; unitHolder.ShowUnitHolder(theSquad); } } diff --git a/Assets/Scripts/Behaviors/UnitCreator/MemberBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/MemberBehaviour.cs index 9f67e64..7b5a577 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/MemberBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/MemberBehaviour.cs @@ -55,7 +55,7 @@ public enum SizeOfMember void Start () { - renderer.enabled = false; + GetComponent().enabled = false; switch (theSizeOfMember) { diff --git a/Assets/Scripts/Behaviors/UnitCreator/MemberTrayBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/MemberTrayBehaviour.cs index 94c3cf4..9debce1 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/MemberTrayBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/MemberTrayBehaviour.cs @@ -143,12 +143,12 @@ void Start () public void ShowMemberTray() { //transform.renderer.enabled = true; - theBackGround.transform.renderer.enabled = true; + theBackGround.transform.GetComponent().enabled = true; //isActive = true; for (int index = 0; index < members.Count; index++) { - members[index].transform.renderer.enabled = true; + members[index].transform.GetComponent().enabled = true; } } diff --git a/Assets/Scripts/Behaviors/UnitCreator/PositionBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/PositionBehaviour.cs index 11cea3a..c68f319 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/PositionBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/PositionBehaviour.cs @@ -23,7 +23,7 @@ public class PositionBehaviour : MonoBehaviour void Start () { - renderer.enabled = false; + GetComponent().enabled = false; } public void SetMemberPosition(MemberBehaviour memberToBeAdded) diff --git a/Assets/Scripts/Behaviors/UnitCreator/StatsPanelBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/StatsPanelBehaviour.cs index 65760b3..c12d5bc 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/StatsPanelBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/StatsPanelBehaviour.cs @@ -10,7 +10,7 @@ public class StatsPanelBehaviour : MonoBehaviour { // Use this for initialization void Start () { - renderer.enabled = false; + GetComponent().enabled = false; } // Update is called once per frame diff --git a/Assets/Scripts/Behaviors/UnitCreator/TrayBackGroundBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/TrayBackGroundBehaviour.cs index 23d0bc3..a559ab9 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/TrayBackGroundBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/TrayBackGroundBehaviour.cs @@ -6,7 +6,7 @@ public class TrayBackGroundBehaviour : MonoBehaviour { // Use this for initialization void Start () { - transform.renderer.enabled = false; + transform.GetComponent().enabled = false; } diff --git a/Assets/Scripts/Behaviors/UnitCreator/UnitPlacementBehaviour.cs b/Assets/Scripts/Behaviors/UnitCreator/UnitPlacementBehaviour.cs index c8563cd..4de7f2c 100644 --- a/Assets/Scripts/Behaviors/UnitCreator/UnitPlacementBehaviour.cs +++ b/Assets/Scripts/Behaviors/UnitCreator/UnitPlacementBehaviour.cs @@ -133,7 +133,7 @@ public void ShowUnitHolder(SquadBehaviour theSquadToEdit) theSquadBeingEdited = theSquadToEdit; for (int index = 0; index < thePositions.Length; index++) { - thePositions[index].transform.renderer.enabled = true; + thePositions[index].transform.GetComponent().enabled = true; } } } diff --git a/Assets/Scripts/Behaviors/Units/CombatSquadBehavior.cs b/Assets/Scripts/Behaviors/Units/CombatSquadBehavior.cs index f6aab76..bb35921 100644 --- a/Assets/Scripts/Behaviors/Units/CombatSquadBehavior.cs +++ b/Assets/Scripts/Behaviors/Units/CombatSquadBehavior.cs @@ -87,7 +87,7 @@ public void Update () if (actor == null) return; - selNode.renderer.material.color = (actor.actorHasMovedThisTurn ? Color.gray : baseColor); + selNode.GetComponent().material.color = (actor.actorHasMovedThisTurn ? Color.gray : baseColor); } /// /// Updates the overworld visuals for the squad. @@ -102,7 +102,7 @@ private void updateSquadVisuals () bool flipHorizontally = (actor == null ? false : actor.theSide == GameControllerBehaviour.UnitSide.player); // Hide any mesh renderer on this object. - gameObject.renderer.enabled = false; + gameObject.GetComponent().enabled = false; // Clear the squad's sub units. List children = new List(); diff --git a/Assets/Scripts/Behaviors/talkingEvents/TalkerBehaviour.cs b/Assets/Scripts/Behaviors/talkingEvents/TalkerBehaviour.cs index d97a642..6361462 100644 --- a/Assets/Scripts/Behaviors/talkingEvents/TalkerBehaviour.cs +++ b/Assets/Scripts/Behaviors/talkingEvents/TalkerBehaviour.cs @@ -11,11 +11,11 @@ public class TalkerBehaviour : MonoBehaviour void Start () { //transform.localScale = - transform.renderer.enabled = false; + transform.GetComponent().enabled = false; } public void SetTalker(Material theTalker) { - transform.renderer.material = theTalker; + transform.GetComponent().material = theTalker; } } diff --git a/Assets/Scripts/Behaviors/talkingEvents/TalkingEventManagerBehaviour.cs b/Assets/Scripts/Behaviors/talkingEvents/TalkingEventManagerBehaviour.cs index bdd25cc..e3244e6 100644 --- a/Assets/Scripts/Behaviors/talkingEvents/TalkingEventManagerBehaviour.cs +++ b/Assets/Scripts/Behaviors/talkingEvents/TalkingEventManagerBehaviour.cs @@ -1406,8 +1406,8 @@ void Update () //Debug.Log("Hi"); if (currentTalkingEventChain[currentTalkingEvent].selectedPanel == Panels.UpperLeft) { - textBox[1].transform.renderer.enabled = true; - talkers[2].transform.renderer.enabled = true; + textBox[1].transform.GetComponent().enabled = true; + talkers[2].transform.GetComponent().enabled = true; activePanels = true; currentPanel = Panels.UpperLeft; textBox[1].startTalkingEvent(currentTalkingEventChain[currentTalkingEvent].normalText, currentTalkingEventChain[currentTalkingEvent].annoyText, currentTalkingEventChain[currentTalkingEvent].name); @@ -1415,8 +1415,8 @@ void Update () } else if (currentTalkingEventChain[currentTalkingEvent].selectedPanel == Panels.UpperRight) { - textBox[1].transform.renderer.enabled = true; - talkers[3].transform.renderer.enabled = true; + textBox[1].transform.GetComponent().enabled = true; + talkers[3].transform.GetComponent().enabled = true; activePanels = true; currentPanel = Panels.UpperRight; textBox[1].startTalkingEvent(currentTalkingEventChain[currentTalkingEvent].normalText, currentTalkingEventChain[currentTalkingEvent].annoyText, currentTalkingEventChain[currentTalkingEvent].name); @@ -1425,8 +1425,8 @@ void Update () else if (currentTalkingEventChain[currentTalkingEvent].selectedPanel == Panels.LowerLeft) { - textBox[0].transform.renderer.enabled = true; - talkers[0].transform.renderer.enabled = true; + textBox[0].transform.GetComponent().enabled = true; + talkers[0].transform.GetComponent().enabled = true; activePanels = true; currentPanel = Panels.LowerLeft; textBox[0].startTalkingEvent(currentTalkingEventChain[currentTalkingEvent].normalText, currentTalkingEventChain[currentTalkingEvent].annoyText, currentTalkingEventChain[currentTalkingEvent].name); @@ -1434,8 +1434,8 @@ void Update () } else if (currentTalkingEventChain[currentTalkingEvent].selectedPanel == Panels.LowerRight) { - textBox[0].transform.renderer.enabled = true; - talkers[1].transform.renderer.enabled = true; + textBox[0].transform.GetComponent().enabled = true; + talkers[1].transform.GetComponent().enabled = true; activePanels = true; currentPanel = Panels.LowerRight; textBox[0].startTalkingEvent(currentTalkingEventChain[currentTalkingEvent].normalText, currentTalkingEventChain[currentTalkingEvent].annoyText, currentTalkingEventChain[currentTalkingEvent].name); @@ -1448,26 +1448,26 @@ void Update () switch (currentPanel) { case Panels.LowerLeft: - textBox[0].transform.renderer.enabled = false; - talkers[0].transform.renderer.enabled = false; + textBox[0].transform.GetComponent().enabled = false; + talkers[0].transform.GetComponent().enabled = false; activePanels = false; currentPanel = Panels.None; break; case Panels.LowerRight: - textBox[0].transform.renderer.enabled = false; - talkers[1].transform.renderer.enabled = false; + textBox[0].transform.GetComponent().enabled = false; + talkers[1].transform.GetComponent().enabled = false; activePanels = false; currentPanel = Panels.None; break; case Panels.UpperRight: - textBox[1].transform.renderer.enabled = false; - talkers[3].transform.renderer.enabled = false; + textBox[1].transform.GetComponent().enabled = false; + talkers[3].transform.GetComponent().enabled = false; activePanels = false; currentPanel = Panels.None; break; case Panels.UpperLeft: - textBox[1].transform.renderer.enabled = false; - talkers[2].transform.renderer.enabled = false; + textBox[1].transform.GetComponent().enabled = false; + talkers[2].transform.GetComponent().enabled = false; activePanels = false; currentPanel = Panels.None; break; diff --git a/Assets/Scripts/Behaviors/talkingEvents/TypeWriterBoxBehaviour.cs b/Assets/Scripts/Behaviors/talkingEvents/TypeWriterBoxBehaviour.cs index c0c99c2..1a19663 100644 --- a/Assets/Scripts/Behaviors/talkingEvents/TypeWriterBoxBehaviour.cs +++ b/Assets/Scripts/Behaviors/talkingEvents/TypeWriterBoxBehaviour.cs @@ -121,7 +121,7 @@ public enum PositionOfTheTextBox void Start () { talkingManager = Camera.main.transform.GetComponent(); - transform.renderer.enabled = false; + transform.GetComponent().enabled = false; } /// diff --git a/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs b/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs index 934a7e1..8a02041 100644 --- a/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs +++ b/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs @@ -8,9 +8,9 @@ public class WaterSimple : MonoBehaviour { void Update() { - if( !renderer ) + if( !GetComponent() ) return; - Material mat = renderer.sharedMaterial; + Material mat = GetComponent().sharedMaterial; if( !mat ) return; diff --git a/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader b/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader index b0a2c1f..0c2da12 100644 --- a/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader +++ b/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader @@ -1,3 +1,5 @@ +#warning Upgrade NOTE: unity_Scale shader variable was removed; replaced 'unity_Scale.w' with '1.0' + Shader "FX/Water (simple)" { Properties { _horizonColor ("Horizon color", COLOR) = ( .172 , .463 , .435 , 0) @@ -41,7 +43,7 @@ v2f vert(appdata v) // scroll bump waves float4 temp; - temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset; + temp.xyzw = v.vertex.xzxz * _WaveScale / 1.0 + _WaveOffset; o.bumpuv[0] = temp.xy * float2(.4, .45); o.bumpuv[1] = temp.wz; diff --git a/Assets/VIZIO/Editor Default Resources/VIZIO Skins.meta b/Assets/VIZIO/Editor Default Resources/VIZIO Skins.meta deleted file mode 100644 index 3dbcfe1..0000000 --- a/Assets/VIZIO/Editor Default Resources/VIZIO Skins.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0eb6bad040253b340baf1a3b2fc5c540 -folderAsset: yes -DefaultImporter: - userData: diff --git a/ProjectSettings/ClusterInputManager.asset b/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000..737873b Binary files /dev/null and b/ProjectSettings/ClusterInputManager.asset differ diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 3c811f3..5bbdb35 100644 Binary files a/ProjectSettings/GraphicsSettings.asset and b/ProjectSettings/GraphicsSettings.asset differ diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..71dd6ab Binary files /dev/null and b/ProjectSettings/NavMeshAreas.asset differ diff --git a/ProjectSettings/UnityConnectSettings.asset b/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000..d6435dc Binary files /dev/null and b/ProjectSettings/UnityConnectSettings.asset differ