Главная | Обратная связь | Поможем написать вашу работу!
МегаЛекции

Access Keywords. Game Design. Risk / Reward. Risk Tolerance. Equations. Easing Functions Cheat Sheet. Logistics Curve. Lerp Two Colors




Access Keywords

This

● The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method

Pass myself along: The this keyword is most often used to pass along a reference to the instance of a calling class to another:

UICanvas newCanvas = new UICanvas();
newCanvas. parentRef = this;
newCanvas. Callibrate( this );

Used to Declare Indexers: public int this [int param] { get/set code; }

https: //docs. microsoft. com/en-us/dotnet/csharp/language-reference/keywords/this

Base

● The base keyword is used to access members of the base class from within a derived class:

○ Call a method on the base class that has been overridden by another method.

○ Specify which base-class constructor should be called when creating instances of the derived class.

Call inherited method (event_inherited): When defining an override for a method in a derived class and you wish to invoke the original code of the base class, use the base keyword combined with the method name:

○ Public override void methodName() {
base. methodName();
New code;
}

My base, not the Root: The “base” you are accessing is the base class from which the current class is derived. So, if “B” inherits from “A”, but “C” inherits from “B”, then if “C” invokes a call to “base” it will be pulling from “B”, not “A”

Base Class Constructor: The “base” keyword can also be used in conjunction with constructors to clarify which constructor you are invoking:

“DerivedClass(constructor parameters WITH type): base (constructor parameters WITHOUT type)”

https: //docs. microsoft. com/en-us/dotnet/csharp/language-reference/keywords/base

Game Design

Risk / Reward

Risk Tolerance

The Five Rules of Risk - YouTube

● In general, people x1000 more likely to tolerate voluntary risk than involuntary risk

○ The more factors which can be piled on to make something involuntary seem like an voluntary risk, the more this can be swayed

● Unfamiliarity increase perceived risk

○ The more educated you are on a subject, the better you understand the risks

Equations

Easing Functions Cheat Sheet

● Easing Functions Cheat Sheet

○ Visualizations of various Easing functions

Logistics Curve

https: //en. wikipedia. org/wiki/Logistic_function

● Google Sheets:
=1/(1+Exp(-6*(x)))

Exp() function: Gives “e” to some power

-6: Steepness of the Curve

■ At -6, this will roughly map 1 to 1, -1 to -1

Lerp Two Colors

Tags: Blend Two Colors, 2 Colors

if (_result < 0. 5f) {

background. color = Color. Lerp(percentLow, percentMedium, _result * 2);

} else {

background. color = Color. Lerp(percentMedium, percentHigh, (_result - 0. 5f) * 2);

}

Unequal Mapping Equation

Tags: Inequal, half

● If (x > 0. 5)

○ y = B * (1 - x) + C * x

● Else

○ y = B * (1 - Abs(x)) + A * Abs(x)

● Google Sheets:
=IF(F2 > 0. 5, C2*(1-E2)+D2*E2, C2*(1-ABS(E2)) + B2 * ABS(E2))

● C#:

if (slider. value < Mathf. Epsilon) {

fundingAmount = fundingMed * (1 - Mathf. Abs(slider. value)) + fundingMin * Mathf. Abs(slider. value);

} else if (slider. value > Mathf. Epsilon) {

fundingAmount = fundingMed * (1 - slider. value) + fundingMax * slider. value;

}

if (_fontScale < 1f) {

   _newFontSize = fSizeMin + (fSizeInitial - fSizeMin) * (_fontScale / 1f);

} else if (_fontScale > 1f) {

   _newFontSize = fSizeInitial + (fSizeMax - fSizeInitial) * ((_fontScale - 1f) / 1f);

}

Lorem Ipsum Dummy Text

Generated from: https: //www. lipsum. com/feed/html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur id orci orci. Ut maximus sagittis magna sed tempor. Nullam a eros ac neque tempus tempor. Suspendisse tincidunt id dui vel lacinia. Maecenas quis rhoncus nibh. Phasellus sed vulputate nulla. Sed consequat arcu vel molestie vulputate. Etiam arcu ligula, convallis at ullamcorper nec, accumsan tristique augue. Nulla eget sodales nisl. Donec nec sollicitudin nibh, vitae posuere sem. Suspendisse porta ultricies commodo. Nunc elementum, diam sit amet placerat faucibus, diam enim dictum ligula, at elementum quam nunc nec velit.

Nullam gravida mi metus, sit amet rutrum tortor semper sit amet. Sed accumsan felis lectus. Suspendisse fermentum arcu felis, eget ullamcorper justo congue non. Fusce viverra nisl augue, sit amet tempor enim malesuada non. Morbi sed justo metus. In convallis faucibus velit non convallis. Praesent hendrerit eros vel leo congue semper. Sed non auctor purus. Phasellus interdum risus vitae felis convallis mattis. Aenean ullamcorper dolor ac lectus rhoncus tincidunt. Nulla facilisi. Ut sagittis massa id eros imperdiet feugiat. Curabitur mollis turpis sed neque bibendum, et aliquet magna fringilla. Vivamus id ante vel velit mattis vulputate. In dictum nisi eget placerat eleifend.

Sed non dolor placerat, bibendum augue vel, elementum nibh. Vestibulum ultricies urna non egestas pharetra. Nunc eu nulla semper, sodales ligula eu, lobortis diam. Pellentesque at tincidunt sapien, id porttitor turpis. Integer euismod consectetur diam, vel egestas est fermentum in. Aliquam tempor nunc ac est dignissim sagittis. Curabitur porttitor tellus diam, id facilisis nunc iaculis ut. Duis arcu dolor, viverra non accumsan non, sodales ac dolor. Morbi eu metus at dolor cursus congue sed id nisl.

Suspendisse nec dui urna. Donec eros nunc, accumsan at luctus et, gravida quis lorem. Pellentesque vel hendrerit nulla. Curabitur vestibulum erat sed est porta gravida. Sed consectetur blandit risus in aliquam. Mauris tempor magna eget ultricies placerat. Aliquam in tempor nibh. Nulla tristique lorem in urna auctor, et imperdiet ex tincidunt. Aliquam hendrerit vitae erat nec eleifend.

Vestibulum hendrerit magna commodo, tristique sapien eget, feugiat metus. Duis egestas condimentum euismod. Duis porttitor laoreet pellentesque. In sed laoreet sem. Cras ac tincidunt sem, nec faucibus mauris. Nulla non pretium purus. Aliquam imperdiet lobortis faucibus. Sed ultricies porta tellus.

Поделиться:





Воспользуйтесь поиском по сайту:



©2015 - 2024 megalektsii.ru Все авторские права принадлежат авторам лекционных материалов. Обратная связь с нами...